https://reprap.org/mediawiki/api.php?action=feedcontributions&user=Espr14&feedformat=atomRepRap - User contributions [en]2024-03-28T08:17:38ZUser contributionsMediaWiki 1.30.0https://reprap.org/mediawiki/index.php?title=MiniMax&diff=189791MiniMax2022-10-16T17:20:32Z<p>Espr14: </p>
<hr />
<div>{{Development<br />
|name = MiniMax<br />
|status = development<br />
|description = Space efficient cartesian 3D printer<br />
|license = [[CC-BY-SA]]<br />
|author = Espr14<br />
|categories =<br />
}}<br />
<br />
== Design motivation ==<br />
* Large print volume with low construction volume.<br />
* Fixed bed (for printing thin and high objects).<br />
* Coverable (covers can be placed directly on the frame).<br />
* Simple design (easy to build, no custom HW needed).<br />
* Most parts reused from a Prusa i3 style printer<br />
<br />
== Construction advantages ==<br />
* Less space on desk<br />
* Lighter construction<br />
* Faster chamber heating and lower heat losses<br />
<br />
== Typical elements ==<br />
* Bed is ~20 mm above the basement.<br />
* Construction width is by ~130 mm wider (only) than bed width.<br />
* X axis is attached to Y axis.<br />
* Y axis is attached to Z axis.<br />
* Z axis is attached to frame.<br />
<br />
== Source of material ==<br />
The goal is to convert Prusa i3 style printer (extruder on X on Z axis, bed on Y axis) into cubic case with fixed bed. At the same time keeping the outer dimensions small with flat sides of frame to attach covers. Unfortunately, you have to buy some parts to achieve small footprint while preserving sturdiness of the frame and axes.</div>Espr14https://reprap.org/mediawiki/index.php?title=MiniMax&diff=189790MiniMax2022-10-16T17:18:59Z<p>Espr14: Typical elements</p>
<hr />
<div>{{Development<br />
|name = MiniMax<br />
|status = development<br />
|description = Space efficient cartesian 3D printer<br />
|license = [[CC-BY-SA]]<br />
|author = Espr14<br />
|categories =<br />
}}<br />
<br />
== Design motivation ==<br />
* Large print volume with low construction volume.<br />
* Fixed bed (for printing thin and high objects).<br />
* Coverable (covers can be placed directly on the frame).<br />
* Simple design (easy to build, no custom HW needed).<br />
* Most parts reused from a Prusa i3 style printer<br />
<br />
== Construction advantages ==<br />
* Less space on desk<br />
* Lighter construction (and little cheaper)<br />
* Faster chamber heating and lower heat losses<br />
<br />
== Typical elements ==<br />
* Bed is ~20 mm above the basement.<br />
* Construction width is by ~130 mm wider (only) than bed width.<br />
* X axis is attached to Y axis.<br />
* Y axis is attached to Z axis.<br />
* Z axis is attached to frame.<br />
<br />
== Source of material ==<br />
The goal is to convert Prusa i3 style printer (extruder on X on Z axis, bed on Y axis) into cubic case with fixed bed. At the same time keeping the outer dimensions small with flat sides of frame to attach covers. Unfortunately, you have to buy some parts to achieve small footprint while preserving sturdiness of the frame and axes.</div>Espr14https://reprap.org/mediawiki/index.php?title=MiniMax&diff=189789MiniMax2022-10-16T14:05:36Z<p>Espr14: Typical elements</p>
<hr />
<div>{{Development<br />
|name = MiniMax<br />
|status = development<br />
|description = Space efficient cartesian 3D printer<br />
|license = [[CC-BY-SA]]<br />
|author = Espr14<br />
|categories =<br />
}}<br />
<br />
== Design motivation ==<br />
* Large print volume with low construction volume.<br />
* Fixed bed (for printing thin and high objects).<br />
* Coverable (covers can be placed directly on the frame).<br />
* Simple design (easy to build, no custom HW needed).<br />
* Most parts reused from a Prusa i3 style printer<br />
<br />
== Construction advantages ==<br />
* Less space on desk<br />
* Lighter construction (and little cheaper)<br />
* Faster chamber heating and lower heat losses<br />
<br />
== Typical elements ==<br />
* Bed is ~20 mm above the basement.<br />
* X axis is attached to Y axis.<br />
* Y axis is attached to Z axis.<br />
* Z axis is attached to frame.<br />
<br />
== Source of material ==<br />
The goal is to convert Prusa i3 style printer (extruder on X on Z axis, bed on Y axis) into cubic case with fixed bed. At the same time keeping the outer dimensions small with flat sides of frame to attach covers. Unfortunately, you have to buy some parts to achieve small footprint while preserving sturdiness of the frame and axes.</div>Espr14https://reprap.org/mediawiki/index.php?title=MiniMax&diff=189786MiniMax2022-10-13T08:14:31Z<p>Espr14: Construction advantages</p>
<hr />
<div>{{Development<br />
|name = MiniMax<br />
|status = development<br />
|description = Space efficient cartesian 3D printer<br />
|license = [[CC-BY-SA]]<br />
|author = Espr14<br />
|categories =<br />
}}<br />
<br />
== Design motivation ==<br />
* Large print volume with low construction volume.<br />
* Fixed bed (for printing thin and high objects).<br />
* Coverable (covers can be placed directly on the frame).<br />
* Simple design (easy to build, no custom HW needed).<br />
* Most parts reused from a Prusa i3 style printer<br />
<br />
== Construction advantages ==<br />
* Less space on desk<br />
* Lighter construction (and little cheaper)<br />
* Faster chamber heating and lower heat losses<br />
<br />
== Source of material ==<br />
The goal is to convert Prusa i3 style printer (extruder on X on Z axis, bed on Y axis) into cubic case with fixed bed. At the same time keeping the outer dimensions small with flat sides of frame to attach covers. Unfortunately, you have to buy some parts to achieve small footprint while preserving sturdiness of the frame and axes.</div>Espr14https://reprap.org/mediawiki/index.php?title=MiniMax&diff=189785MiniMax2022-10-12T13:56:47Z<p>Espr14: Origin of material</p>
<hr />
<div>{{Development<br />
|name = MiniMax<br />
|status = development<br />
|description = Space efficient cartesian 3D printer<br />
|license = [[CC-BY-SA]]<br />
|author = Espr14<br />
|categories =<br />
}}<br />
<br />
== Design motivation ==<br />
* Large print volume with low construction volume.<br />
* Fixed bed (for printing high objects).<br />
* Coverable (covers can be placed directly on the frame).<br />
* Simple design (easy to build, no custom HW needed).<br />
<br />
== Source of material ==<br />
The goal is to convert Prusa i3 style printer (extruder on X on Z axis, bed on Y axis) into cubic case with fixed bed. At the same time keeping the outer dimensions small with flat sides of frame to attach covers. Unfortunately, you have to buy some parts to achieve small footprint while preserving sturdiness of the frame and axes.</div>Espr14https://reprap.org/mediawiki/index.php?title=MiniMax&diff=189784MiniMax2022-10-12T13:49:55Z<p>Espr14: First info</p>
<hr />
<div>{{Development<br />
|name = MiniMax<br />
|status = development<br />
|description = Space efficient cartesian 3D printer<br />
|license = [[CC-BY-SA]]<br />
|author = Espr14<br />
|categories =<br />
}}<br />
<br />
== Design motivation ==<br />
- Large print volume with low construction volume.<br />
- Fixed bed.<br />
- Coverable (cover placed directly on the skeleton).<br />
- Simple design (easy to build, no custom HW needed).</div>Espr14https://reprap.org/mediawiki/index.php?title=Build_a_RepRap&diff=189783Build a RepRap2022-10-12T13:39:20Z<p>Espr14: Add a new RepRap printer</p>
<hr />
<div>{{Languages|RepRap Options}}<br />
{{merge from | Resources }}<br />
<br />
This page attempts to make some sense, in general, of how all the pieces fit together to create a RepRap.<br />
<br />
However, if you want to skip all this stuff and get straight to getting your hands dirty then your best bet is to take a look at [[The incomplete RepRap beginner's guide]] and the [[build instructions]] category. In addition to those guides, you may also want to take a look at the links under the [[RepRap Options#Models|Models]] section below.<br />
<br />
[[file:RepRap_Component_Structure.svg|thumb|upright=2.5|RepRap Component Structure.]]<br />
<br />
That being said, to get a higher-level overview, we must start with discussing the different models of RepRaps, then go on to the four main components of a RepRap: <br />
* The software toolchain.<br />
* The electronics.<br />
* The mechanical body.<br />
* The extruder.<br />
<br />
<br />
== Models ==<br />
<br />
These days there are a growing number of many great and detailed [[build instructions]]<br />
for RepRaps! Click on the name below the pictures to see more about each design.<br />
<br />
If you're steampunk or just like to get away without commercial kits, there are also [[RepStrap]]s.<br />
<br />
<gallery widths=200 heights=150 perrow=6><br />
File:All 3 axes fdmd sml.jpg|[[Darwin]] (''license: [[GPL]]'')|link=[[Darwin]]<br />
File:Mendel.jpg|[[Mendel]] (''license: [[GPL]]'')|link=[[Mendel]]<br />
File:assembled-prusa-mendel.jpg|[[Prusa Mendel]] (''license: [[GPL]]'')|link=[[Prusa Mendel]]<br />
File:2-i3-Berlin-Perspective-Web-Optimized.jpg|[[i3Berlin]] (''license: [[GPL]]'')|link=i3Berlin<br />
File:Prusai3-metalframe.jpg|[[Prusa i3]] (''license: [[GPL]]'')|link=[[Prusa i3]]<br />
File:RRPFisher.jpg|[[Fisher]] (''license: [[GPL]]'')|link=[[Fisher]]<br />
File:kunprinter_pro.jpg|[[KunPrinter-K86/zh cn|K86]] (''license: [[CC-BY-NC-SA]]'')|link=[[KunPrinter-K86/zh_cn]]<br />
File:huxley.jpg|[[Huxley]] (''license: [[GPL]]'')|link=[[Huxley]]<br />
File:Holliger.jpeg|[[Holliger]] (''license: [[GPL]]'')|link=[[Holliger]]<br />
File:Wolfy11.jpg|[[Wolfy1.1]] (''license: [[GPL]]'')|link=[[Wolfy1.1]]<br />
File:Mix-g1.jpeg|[[Mix_g1|Mix G1]] (''license: [[GPL]]'')|link=[[Mix_G1]]<br />
File:DSC0382-682x1024.jpg|[[RepRap Morgan]] (''license: [[GPL]]'')|link=[[RepRap Morgan]]<br />
File:Simpson2013.jpg|[[Simpson]] (''license: [[GPL]]'')|link=[[Simpson]]<br />
File:3DPrintMi.JPG|[[3DPrintMi]] (''license: [[GPL]]'')|link=[[3DPrintMi]]<br />
File:printrbot.jpg|[[Printrbot]] (''license: [[CC-BY-SA]]'')|link=[[Printrbot]]<br />
File:Wallace.jpg|[[Wallace]] (''license: [[GPL]]'')|link=[[Wallace]]<br />
File:Microbot.jpg|[[Tantillus]] (''license: [[GPL]]'')|link=[[Tantillus]]<br />
File:Tantillus_R_001.jpg|[[Tantillus R]] (''license: [[GPL]]'')|link=[[Tantillus R]]<br />
File:CartesioW1.jpg|[[Cartesio]] (''license: [[CC-BY-NC-SA]]'')|link=[[cartesio]]<br />
File:SimpleXL.jpg|[[TowerSimpleXL]] (''license: [[GPL]]'')|link=[[TowerSimpleXL]]<br />
File:Reprappro-Mendel.jpg|[[RepRapPro_Mendel|RepRapPro Mendel]] (''license: [[GPL]]'')|link=[[RepRapPro Mendel]]<br />
File:Reprappro-huxley.jpg|[[RepRapPro_Huxley|RepRapPro Huxley]] (''license: [[GPL]]'')|link=[[RepRapPro Huxley]]<br />
File:Eventorbot_reprap_1.jpg|[[Eventorbot]] (''license: [[CC-BY-SA]]'')|link=[[Eventorbot]]<br />
File:Kossel.jpg|[[Kossel]](''license:[[GPL]]'')|link=[[Kossel]]<br />
File:3D_Printer1.jpg|[[3drag]] (''license: [[CC-BY-SA]]'')|link=[[3drag]]<br />
File:MendelMaxPlaceholder.jpg|[[MendelMax]] (''license: [[GPL]]'')|link=[[MendelMax]]<br />
File:MendelMax2 front.jpg|[[MendelMax 2.0]] (''license: [[GPL]]'')|link=[[MendelMax 2.0]]<br />
File:EM1-Light_ISO.jpg|[[EAGLEmake_EM1-Light]] (''license: [[CC-BY-NC-SA]]'')|link=[[EAGLEmake EM1-Light]]<br />
File:Mendel90_Dibond.jpg|[[Mendel90]] (''license: [[GPL]]'')|link=[[Mendel90]]<br />
File:Lui.png |[[case-rap 2.0]] (''license: [[GPL]]'')<br />
File:Open-closed.jpg |[[case-rap]] (''license: [[GPL]]'')<br />
File:GD01 A.jpg|[[GolemD]] (''license: [[CC-BY-SA]]'')|link=[[GolemD]]<br />
File:LOGO_D180PIX.jpg|[[Wood3D]] (''license: [[CC-BY-NC-SA]]'')|link=[[Wood3d]]<br />
File:Folda4.0-color.jpg|[[FoldaRap]] (''license: [[GPL]]'')|link=[[FoldaRap]]<br />
File:AdaptoBIG.jpg|[[Adapto]] (''license: [[GPL]]'')|link=[[Adapto]]<br />
File:SibRap.jpg|[[SibRap]] (''license: [[GPL|GPLv3]]'')|link=[[SibRap]]<br />
File:Haeckel1.JPG|[[Haeckel]] (''license: [[GPL]]'')|link=[[Haeckel]]<br />
File:3DMakerWorld_Artifex_Front.jpg|[[Artifex]] (''license: [[CC-BY-SA]]'')|link=[[Artifex]]<br />
File:R-360.jpg|[[R_360|R-360]] (''license: [[CC-BY-SA]]'')|link=[[R_360]]<br />
File:Smartrap 046.jpg|[[Smartrap mini]] (''license: [[GPL]]'')|link=[[Smartrap mini]]<br />
File:Wilson.jpg|[[Wilson]] (''license: [[GPL]]'')|link=[[Wilson]]<br />
File:Remix purple fixed smaller.jpg|[[Kiwi remix]] (''license: [[GPL]]'')|link=[[Kiwi remix]]<br />
File:UDelta.jpg|[[Micro Delta]] (''license: [[CC-BY-NC-SA]]'')|link=[[Micro Delta]]<br />
File:Ormerod_kit_big1.png|[[Ormerod]] (''license: [[GPL]]'')|link=[[Ormerod]]<br />
File:sid.jpg|[[Sid]] (''license: [[CC-BY-SA]]'')|link=[[Sid]]<br />
File:sam-pic_front-iso-1.jpg|[[RepRap_Samuel|Samuel]] (''license: [[GPL]]'')|link=[[RepRap_Samuel]]<br />
File:Litoneb-2 bd.jpg|[[Litone]] (''license: [[GPL]]'')|link=[[Litone]]<br />
File:impresoranew.jpg|[[MM1|MM1]] (''license: [[CC-BY-NC-SA|CC-BY-SA-NC]]'')|link=[[MM1]]<br />
File:Ulticampy2-1.jpeg|[[Ulticampy]] (''license: [[CC-BY-NC-SA]]'')|link=[[Ulticampy]]<br />
File:Atomxfirst.jpg|[[AtomX]] (''license: [[CC-BY-SA]]'')|link=[[AtomX]]<br />
File:Funbot_i1.jpg|[[Funbot_i1]] (''license: [[CC-BY-SA]]'')|link=[[Funbot_i1]]<br />
File:Rostock Mini Pro.jpg|[[Rostock Mini Pro]] (''license: [[GPL]]'')|link=[[Rostock Mini Pro]]<br />
File:Abbas3d.JPG|[[Abbas]] (''license: [[GPL]]'')|link=[[Abbas]]<br />
File:AdaptoFlex.jpg|[[Adapto Flex]] (''license: [[GPL]]'')|link=[[Adapto Flex]]<br />
File:0Z3M2ab.jpg|[[E1x]] (''license: [[CC-BY-NC-SA]]'')|link=[[E1x]]<br />
File:nelu_Delta_robot_v2.png|[[Nelu]] (''license: [[GPL]]'')|link=[[3d_printer_nelu]]<br />
File:Molestock_S-3D_printer.jpg|[[Molestock]] (''license: [[CC-BY-NC-SA]]'')|link=[[Molestock]]<br />
File:2015-08-02_ToyREP-Final.jpg |[[ToyREP]] (''license: [[CC-BY-SA]]'')|link=[[ToyREP]]<br />
File:I3.jpg |[[XI3]] (''license: [[GPL]]'')|link=[[XI3]]<br />
File:ITopie.png|[[ITopie]] (''license: [[GPL]]'')|link=[[ITopie]]<br />
File:magikisfabrikis.png|[[Magikis Fabrikis]] (''license: [[CC-BY-SA]]'')|link=[[Magikis_Fabrikis]]<br />
File:Snappy_small_v3.0.png|[[Snappy 3]] (''license: [[GPL]]'')|link=[[Snappy 3]]<br />
File:M Prime One FreeCAD iso.png|[[M Prime One]] (''license: [[CC-BY]]'')|link=[[M_Prime_One]]<br />
File:3DoneP5.jpg|[[3Done]] (''licence: [[CC-BY-NC-SA]]'')|link=[[3Done]]<br />
File:JennyPrinter_minimalist.jpg|[[JennyPrinter minimalist]] (''licence: [[CC-BY-NC-SA]]'')|link=[[JennyPrinter_minimalist]]<br />
File:SpatialOne.jpg|[[SpatialOne]] (''license: [[CC-BY-NC-SA]]'')|link=[[SpatialOne]]<br />
File:Reprap-Intro.jpg|[[RepRap Intro]] (''license: [[GPL]]v2'')|link=[[RepRap Intro]]<br />
File:Mendel_Rostock.jpg |[[Mendel Rostock]] (''license: [[GPL]]'')<br />
File:Prusa i3 ION.PNG|[[Prusa i3 ION]] (''license: [[GPL]]'')|link=[[Prusa i3 ION]]<br />
File:se1x_rrp.jpg.png|[[sE1X]] (''license: [[gpl]]'')|link=[[sE1x]]<br />
File:SRJ-I.jpg|[[SRJ]] (''license: [[GPL]]'')|link=[[SRJ]]<br />
File:EAGLEmake_EM1-Pro_(Light).PNG|[[EAGLEmake_EM1-Pro]] (''license: [[CC-BY-NC-SA]]'')|link=[[EAGLEmake_EM1-Pro]]<br />
File:reprap_pyramid_1.jpg|[[Reprap Pyramid]] (''license: [[GPL]]'')|link=[[Reprap Pyramid]]<br />
File:reprap_next_01.jpg|[[Reprap Next]] |link=[[ReprapNext]]<br />
File:I3-2xz.jpg|[[2Xz]] (''license: [[GPL]]'')|link=[[2xz]]<br />
File:Chimera-Steel.jpg|[[Chimera]] |link=[[Chimera]]<br />
File:Kit_web.jpg |[[Egyptian RepRap]] (''license: [[GPL]]'')|link=[[Egyptian RepRap]]<br />
File:EM One+_1.3_1.png|[[EAGLEmake_EM One+]] (''license: [[CC-BY-NC-SA]]'')|link=[[EAGLEmake EM One+]]<br />
File:ctor-bot-view.png|[[.ctor-bot]] (''license: [[GPL]]'')|link=[[.ctor-bot]]<br />
File:Mulbot.jpg|[[Mulbot]] (''license: [[GPL]]'')|link=[[Mulbot]]<br />
File:MPM printer.jpeg|[[MPM]] (''license: [[GPL]]'')|link=[[MPM]]<br />
File:Cairo_mini_main_edited_ag.jpg|[[Cairo Mini 3d Printer]] (''license: [[CC-BY-SA]]'')|link=[[Cairo_Mini_3d_Printer]]<br />
File:00header.jpg|[[Prusa3StarWarsEdition]] (''license: [[GPL]]'')|link=[[Prusa3StarWarsEdition]]<br />
File:MiniMax|[[MiniMax]] (''license: [[CC-BY-SA]]'')|link=[[MiniMax]]<br />
</gallery><br />
<br />
== Software Toolchain ==<br />
<br />
The software toolchain can be roughly broken down into 3 parts:<br />
# CAD tools.<br />
# CAM tools.<br />
# Firmware for electronics.<br />
<br />
=== CAD Tools ===<br />
Computer Aided Design, or CAD, tools are used to design 3D parts for printing.<br />
<br />
==== Software ====<br />
[[Wikipedia:Computer-aided_design|CAD tools]] in the truest sense are designed to allow you to easily change and manipulate parts based on parameters. Sometimes CAD files are referred to as ''parametric'' files. They usually represent parts or assemblies in terms of [[Wikipedia:Constructive solid geometry|Constructive Solid Geometry]], or CSG. Using CSG, parts can be represented as a tree of boolean operations performed on primitive shapes such as cubes, spheres, cylinders, pyramids, etc. <br />
<br />
[[Wikipedia:Free_and_open_source_software|Free/Libre/Open Source Software]] (''[[Wikipedia:Alternative_terms_for_free_software|FLOSS]]'') applications that fall into this category would be [[OpenSCAD]], [[FreeCAD]] and [[Wikipedia:HeeksCAD|HeeksCAD]] and [[Wikipedia:List_of_computer-aided_design_editors|more]]. Examples of [[Wikipedia:Proprietary_software|proprietary]] and fully parametric CAD tools are [[Wikipedia:Creo_(design_software)|PTC Creo]] (formerly PTC Pro/Engineer), [[Wikipedia:SolidWorks|Dassault Solidworks]], [[Wikipedia:Autodesk_Inventor|Autodesk Inventor]] and [[Wikipedia:List_of_computer-aided_design_editors|more]].<br />
<br />
Typically in such programs the geometry is stored in a feature tree where the dimensions can be modified numerically, and the geometry is then regenerated with great precision. The geometry is a mathematical representation where, for example, a circle is generated from its center, radius and plane parameters (hence, "parametric"). No matter how much you zoom in, a circle is still curved, and the CAD program has no problem finding its center when you click on it. This can be quite beneficial when making drawings with dimensions between the circle and sections that need to be concentrically removed.<br />
<br />
Another looser category of CAD tool would be apps that represent parts as a 3D [[Wikipedia:Polygon mesh|Polygon mesh]]. These applications are meant to be used more for special effects and artistic applications. They also seem to be a little more user-friendly. [[Wikipedia:Free_and_open_source_software|FLOSS]]-apps in this category would be [[Wikipedia:Blender_(software)|Blender]] and [[Wikipedia:Art_of_Illusion|Art of Illusion]]. [[Wikipedia:Proprietary_software|Proprietary]] tools are [[Wikipedia:3D_Studio_Max|Autodesk 3ds Max]], [[Wikipedia:Autodesk_AliasStudio|Autodesk Alias]], [[Wikipedia:Google_Sketchup|SketchUp]] and more.<br />
<br />
Furthermore, you can create forms with just a web-browser at certain websites, such as [http://tinkercad.com TinkerCAD.com] (easy) or [http://3dtin.com 3DTin.com] (more sophisticated), those permit you to download the resulting geometry.<br />
<br />
Some of the tools mentioned above also use parametric data to generate the geometries, but a lot just register the positions of the vertices of the polygons making up the models. Some use parameters to generate the geometry but then drops that data once the vertices are placed. A curve is thus actually an approximation, generated from a number of straight lines between points. As such, those tools are better suited for design where the precision of dimensions are less important than looks and ease of use.<br />
<br />
If you want to print as less possible material as possible; design parts optimised by volume in function of strains, you may use topology optimization through non-commercial-use-only software such as Topostruct (see sawapan.eu website), BESO, or free-open-source-use such as Topy, a topology optimization software written in Python by the brilliant William Hunter (see google code topy page).<br />
<br />
It might be useful to have a lattice engineering software, that will create a support of your part or fill the part to save material. One of the most used is Materialize Magics, but there is also Netfabb. Both are proprietary software's, not free.<br />
<br />
==== Files ====<br />
Most of the time 3D software apps save their files in an application-specific format, which in the case of proprietary CAD tools usually are frequently changed and heavily guarded trade secrets.<br />
<br />
There are very few interchangeable CAD [[File Formats|file formats]]. The two most widely used interchangeable CSG file formats are [[File Formats|STEP]] and [[File Formats|IGES]]. Both strip the geometries from parametric data and offer only "dead" solids. Features can be added and removed, but the base shape is locked. ''There is to date no industry-wide interchangeable file format that retain parametric data''.<br />
<br />
The most widely used interchangeable mesh file format is [[File Formats|STL]]. STL files are important because, as we will see below, they are used by CAM tools.<br />
<br />
Mesh files cannot be converted into CSG file formats because they contain no parametric data - only the coordinates of the polygon vertices that make up the solid volume. However, CSG file formats ''can'' be converted into mesh file formats. <br />
<br />
Thus, if you're designing a part, it's a good idea to design it using a CSG CAD application and save and distribute its original parametric file along with generated STL files.<br />
<br />
<gallery><br />
File:PRT.png|Parametric file format<br />
File:STEP.png|STEP export format<br />
File:STL.png|STL mesh format<br />
</gallery><br />
<br />
=== CAM Tools ===<br />
Computer Aided Manufacturing, or CAM, tools handle the intermediate step of translating CAD files into a machine-friendly format used by the RepRap's electronics. More info is on the [[CAM Toolchains]] page.<br />
<br />
==== Software ====<br />
<br />
===== Slicing Software =====<br />
In order to turn a 3D part into a machine friendly format, CAM software needs an [[File Formats|STL]] file. The machine friendly format that is used for printing is called [[G-code]]. Early versions of RepRaps used a protocol called [[SNAPComms|SNAP]] but industry standard G-codes are now used. To Convert STL files to G-code, you can use one of the following programs: <br />
<br />
# [[MatterSlice]] (Fast and full featured - works with [[MatterControl]])(open source)<br />
# [[Skeinforge]] (Dated solution)(Still one of the best and highly recommended for accurate prints<br />
# [[Cura]] (Also includes G-Code sender)(Extremely fast and accurate)<br />
# [[Slic3r]] (Popular solution for most RepRappers)(Lots of bugs in every release)<br />
# [[Kisslicer]] (Fast and accurate with very few bugs)(Closed source)<br />
# [[RepSnapper]]<br />
# [[Mendel User Manual: Host Software|RepRap Host Software]]<br />
# [[X2sw]]<br />
# [[SuperSkein]]<br />
# [[SlicerCloud]] (Online Slic3r solution)<br />
# [[Simplify3D]] (All-In-One Paid Suite)<br />
# [http://www.cloud3dprint.com/ Cloud3Dprint] (Slice your 3D files for over 150 supported printers or enter your own customized 3d printer parameter)<br />
<br />
The STL to G-code conversion slices the part like salami, then looks at the cross section of each slice and figures out the path that the print head must travel in order to squirt out plastic, and calculates the amount of filament to feed through the extruder for the distance covered.<br />
<br />
(Normally you don't need to repair, edit or manipulate STL files directly, but if you do, you might find the software at [[Useful Software Packages#Software for dealing with STL files]] useful).<br />
<br />
===== G-code interpreter =====<br />
After you have your G-code file, you have to run it through a G-code interpreter. This reads each line of the file and sends the actual electronic signals to the motors to tell the RepRap how to move. There are two main ways to run a G-code interpreter:<br />
<br />
<br />
1) The most common way is to interpret G-code in the firmware of a microcontroller. Typically, the microcontroller is [[wikipedia:Atmel AVR|AVR]]-based which is what's used in the [[wikipedia:Arduino|Arduino]]. In order to transfer the g-codes to the microcontroller, you need a way to send the g-code to the microcontroller. See below for more details.<br />
<br />
<br />
2) The alternate way is to interpret G-code using software that runs on a multi-purpose O/S such as linux. Two examples are [[EMC]] and [[Redeem]]. With these types of interpreters, THERE IS NO GCODE SENDER. The operating system communicates directly with special hardware that controls the motor signals. For EMC, it typically uses the computer's parallel port. For Redeem, it uses the [http://elinux.org/BeagleBone_PRU_Notes PRU] built into the Texas Instruments ARM CPU on the [[wikipedia:BeagleBoard|Beaglebone Black]].<br />
<br />
<br />
===== G-code sender =====<br />
To send the G-code files to a microcontroller's g-code interpreter, you need to either to:<br />
<br />
# Load the G-code file on an memory card (typically SD card) if supported.<br />
# Drip-feed the G-codes (usually a line at a time) over a serial port (RS-232 or TTL level, often used with a USB converter) or a direct USB connection using one of the following programs on your workstation:<br />
<br />
:* [[MatterControl]]<br />
:* [[ReplicatorG]]<br />
:* [[RepSnapper]]<br />
:* [[RepRaptor]]<br />
:* [[Mendel User Manual: Host Software|RepRap Host Software]]<br />
:* [[ArduinoSend|send.py]]<br />
:* [[reprap-utils]]<br />
:* [[Pronterface]]<br />
:* [[RebRep]]<br />
:* [[Repetier-Host]]<br />
:* [[X2sw]]<br />
:* [[Simplify3D]]<br />
:* [https://github.com/minad/3delta 3Delta]<br />
Some of the options are cross platform while others will only work with certain operating systems or prefer specific integrated firmware interpreters.<br />
<br />
==== Part Files ====<br />
The main files use by CAM tools are [[File Formats|STL]] and [[File Formats|G-code]] files. CAM tools convert STL files into G-code files. The official STL files for [[Mendel]] are stored in the RepRap [[Wikipedia:Apache Subversion|subversion]] repository. To get a copy of these files, run the following commands in ubuntu:<br />
<br />
sudo apt-get install subversion<br />
svn co https://svn.code.sf.net/p/reprap/code/trunk/mendel/mechanics/solid-models/cartesian-robot-m4/printed-parts/<br />
<br />
This will create a directory full of STL files that you can then give to your neighbor that already has a RepRap and they can print out the parts for you. You will also notice that this directory contains [[File Types|AoI files]]. These files are for [[AoI|Art of Illusion]]. It is the CAD application that was used to design the parts and then save them as STL files.<br />
<br />
=== Firmware ===<br />
Reprap electronics are controlled by an inexpensive CPU such as the Atmel AVR processor. Atmel processors are what Arduino-based microcontrollers use. These processors are very wimpy compared to even the average 10 to 15 year old PC you find in the dump nowadays. However, these ''are'' CPUs so they do run primitive software. This primitive software they run is the Reprap's ''firmware''.<br />
<br />
Of the entire software chain that makes the Reprap work, the firmware portion of it is the closest you get to actual programming. Technically, the term for what you are doing with firmware is called [[Wikipedia:Cross compiler|cross compiling]]. <br />
<br />
This process more or less consists of the following steps:<br />
# Install the [http://arduino.cc/en/Main/Software Arduino IDE] on your PC.<br />
# Download some firmware source code from a website.<br />
# Make some minor changes to the source code to specify what hardware you have.<br />
# Compile the firmware using the Arduino [[Wikipedia:Integrated development environment|IDE]].<br />
# Connect the controller to your PC via a USB cable.<br />
# Upload the firmware to your controller's CPU.<br />
<br />
Some electronics like [[Smoothieboard]] require a custom firmware. <br />
<br />
<br />
==== G-codes ====<br />
After your microcontroller has its firmware loaded, it is ready to accept [[G-code]]s via the software-emulated [http://en.wikipedia.org/wiki/Serial_port RS-232 serial port] (aka COM port). This port shows up when you plug in your arduino to the PC via USB. You can either use a program to send these G-codes over the serial port or you can type them in by hand if you fire up a plain-old terminal application like hyperterm or minicom. If you use a program, they generally take files in [[File Formats|gcode]] format.<br />
<br />
For all available firmwares see ''[[List of Firmware]]''. The following is a brief list of the most popular firmware:<br />
<br />
* [[List of Firmware#Sprinter|Sprinter]]<br />
* [[List of Firmware#Marlin|Marlin]]<br />
* [[List of Firmware#Teacup| Teacup]]<br />
* [[Smoothie]]<br />
<br />
==== Software ====<br />
To compile and upload firmware to your arduino-based electronics, you use the arduino IDE that you can download from the arduino website.<br />
<br />
==== Files ====<br />
The firmware files are usually packaged as source code for an Arduino [[Wikipedia:Integrated development environment|IDE]] project. Arduino source code consists of a bunch of [[File Formats|PDE]] (or as of Arduino ver 1.0, [[File Formats|INO]]) files along with some extra <tt>.cpp</tt> and <tt>.h</tt> files thrown in. The Arduino IDE compiles the source code into a single <tt>.hex</tt>file. When you click on the upload icon in the Arduino IDE, it uploades the .hex file to the electronics.<br />
<br />
== More Info ==<br />
In a nutshell, here's a short summary of everything above except CAD software:<br />
<br />
[[File:RepRap Toolchain.jpg|1024px]]<br />
<br />
== Electronics ==<br />
<br />
=== Overview ===<br />
In general, all RepRap electronics are broken down into five different areas:<br />
<br />
==== The controller ==== <br />
The controller is the brains of the RepRap. Almost all RepRap controllers are based on the work of the [[Wikipedia:Arduino|Arduino]] microcontroller. While a lot of variations exist, they are exchangeable and basically all do the same thing. Sometimes the controller is a stand-alone circuit board with chips on it, sometimes the controller is an [http://www.arduino.cc/en/Main/ArduinoBoardMega Arduino Mega] with an add-on board (called a 'shield'). Find more at [[List of electronics]].<br />
<br />
==== Stepper Motors ==== <br />
A [[stepper motor]] is a type of electric motor that can be accurately controlled with the controller. Most RepRaps use four or five stepper motors. Three or four motors control the x/y/z axis movement (sometimes the z axis is controlled by two motors) and one motor is used per [[extruder]].<br />
<br />
==== Stepper Drivers ==== <br />
A [[stepper motor#Driving stepper motors|stepper driver]] is a chip that acts as a kind of middle-man between a stepper motor and the controller. It simplifies the signals that need to be sent to the stepper motor in order to get it to move. <br />
<br />
Sometimes the stepper drivers are on separate circuit boards that are linked to the controller via cables. <br />
<br />
Sometimes the stepper drivers are on small circuit boards that plug directly into the controller itself. In this case, the controller will have space for at least 4 of these small circuit boards (one for each stepper motor). <br />
<br />
Finally, sometimes the stepper drivers are soldered right onto the controller itself.<br />
<br />
==== End stops ==== <br />
An [[end stop]] is a very small and simple circuit board with a switch of some sort on it that tells the RepRap when it has moved too far in one direction. Thus, there's normally six of these: two for each axis (most firmware include software settings for max position, which allows for only the minimum position end stops to be required). A single end stop connects via wires to either:<br />
# The controller.<br />
# A stepper driver board.<br />
<br />
==== Heated Bed ==== <br />
The print bed is what the RepRap extrudes plastic onto, where the plastic parts are built up.<br />
<br />
While a [[heated bed]] is considered to be an optional component of a RepRap, it often becomes a necessary and integral part of operating a RepRap over the long-term because, without a heated bed, parts have a tendency to cool down too quickly. This results in warping of corners (as the plastic shrinks while cooling) or the part physically detaching from the print bed too early, ruining the print. <br />
<br />
Heated beds operate on the same principle as a kitchen toaster. They're just giant resistors with a temperature sensor. See also:<br />
* [[PCB Heatbed]]<br />
* [http://2.bp.blogspot.com/-L9q_ScmVcVI/UYFUGYXK-FI/AAAAAAAABUg/0AOrsgd88uY/s1600/RepRapWiringDiagram.jpg RAMPS 1.2 Wiring Diagram].<br />
* [[RepRapPro_Mendel_heatbed_assembly|The Prusa Mendel Heatbed Assembly Article]]<br />
* [http://www.lhd-pcb.com PCB hot bed use guide]<br />
<br />
=== More Information ===<br />
To see more details about RepRap electronics, take a look at the [[List of electronics]] page.<br />
<br />
== Mechanical Body ==<br />
When it comes to the mechanical body, it can be generally broken down into two parts: <br />
# Movement along the x/y/z axes.<br />
# The print bed<br />
<br />
=== X/Y/Z Axis Motion ===<br />
Main category page for [[:Category:Mechanical arrangement|Mechanical arrangement]]<br />
<br />
When facing the front of a RepRap, X axis movement is side to side, aka left to right movement, Y axis movement is forwards/backwards movement and Z axis movement is up and down along the vertical plane.<br />
<br />
Linear movement is generally accomplished using one of 2 different methods:<br />
# Belt/pulley driven motion.<br />
# Threaded rod or leadscrew motion.<br />
<br />
Belts and pulleys are good for fast/lightweight movement and threaded rods are good for slow but forceful movement. Most RepRaps use a combination of belts for X/Y axis movement and threaded rod for Z axis movement. <br />
<br />
==== Belts and Pulleys ====<br />
When it comes to accuracy, the most important part of your RepRap is your belt/pulley combination. Current state of the art is the GT2 belt, along with a machined pulley that matches the exact bore size of your stepper motors (normally this is 5&nbsp;mm).<br />
<br />
There are many types of belt/pulley combinations, currently (March 2012) most in use are:<br />
;T5: These are ''asynchronous'' metric timing belts. They have trapezoidal teeth and deliberate backlash to reduce belt wear and noise for ''uni-directional'' applications. They are difficult to get in North America. The pulleys themselves though can be printed. Using a printed pulley will give you approximately the same results as if you use an MXL pulley/belt combination with the wrong bore size.<br />
;T2.5: Like the T5 these are asynchronous metric belt/pulley combinations. These have a 2.5mm (.098") pitch and are printable. With the same diameter pulleys there is a better grip (compared to t5) on the belt and will give a better result. The best results are with metal pulleys due to the fine tooth profile.<br />
;MXL: This stands for "mini extra-light". These belts have been around since the 1940s. Like T5 & T2.5, these are also asynchronous timing belts but they are common in North America because they use imperial sizes. The distance between teeth is 0.08" and the teeth are trapezoidal. You *may* be able to find pulleys that have a 5mm bore but it seems difficult. Most stepper motors have spindles that are 5mm in diameter.<br />
;HTD: This stands for "high torque drive" and was introduced by [http://www.gates.com/ Gates] in 1971. These belts have less backlash than MXL and T5 belts because the teeth are deeper and are rounded. These belts were originally patented by Gates but the Patent has since expired.<br />
;GT2: These are Gates PowerGrip® GT®2 industrial ''synchronous'' timing belts. GT stands for "Gates Tooth". GT2 came about because the HTD patents ran out and they needed a new tooth profile that was not public domain. Gates says the GT2 belts will run OK on HTD pulleys but not the other way around. GT2 belts are stronger than HTD belts, but they need the GT2 tooth profile on the pulleys to achieve their ultimate strength advantage over HTD. These may be more difficult to find everywhere.<br />
;Spectra: Spectra fiber braided fishing line is quickly becoming a popular choice to replace belts in many applications after its first implementation in Tantillus and then in many Delta printers. It is cheap and available in most cities around the world. Once tightened correctly it has almost no backlash and provides very smooth movement due to the lack of bumpy teeth and its incredibly small bend radius allowing high steps per mm.<br />
<br />
For more info see [[Choosing Belts and Pulleys]].<br />
<br />
==== Threaded rod ====<br />
Most RepRaps use threaded rod for the Z axis. The Z axis doesn't have to move fast (but it is better if it can move quickly) because it generally only goes up tenths of a mm at a time. Threaded rod is ok for accuracy and force. Repraps don't require force but some [[Wikipedia:CNC|CNC]] machines, use threaded rod for all 3 axes. Since the Z axis threaded rods support the weight of the x-carriage it's a good idea to use high-strength stainless steel for the rod and nut, otherwise they will suffer greater wear on the threads and experience premature failure.<br />
<br />
==== Notes on Backlash ====<br />
One thing to note about all ways of moving is ''backlash''. Backlash is that jigglyness that you feel in both threaded rod and belts/pulleys when you ''change direction''. This jigglyness/sloppiness affects accuracy.<br />
<br />
The T5 and MXL belts above were originally designed to be used as timing belts. Timing belts normally only spin in one direction so backlash is not an issue. Thus, because the GT2 belts were designed to change direction, they will be more accurate.<br />
<br />
The standard way of compensating for threaded rod backlash is to use 2 nuts and force them apart using a spring. This kind of makes sure that the nuts are always pushing against the threads so that when you change direction, it doesn't jiggle. Not sure if that makes sense but I'll leave it here anyways.<br />
<br />
=== Print Bed ===<br />
The print bed is what parts get printed on. The print bed may be stationary, like with the original RepRap [[RepRapOneDarwin|Darwin]], or it may move along one of the x/y/z axes. Most RepRaps have the bed move along the Y axis but some will also move along the Z axis.<br />
<br />
The bed usually consists of two plates: the upper plate and the lower plate. <br />
<br />
==== Upper Plate ====<br />
The upper plate is mounted to the lower plate on springs. The springs allow it to be levelled using adjusting screws. It also (I think) was designed this way because it gives a little if you accidentally ram the print head down into it.<br />
<br />
The upper plate may or may not be heated. It's usually made of a PCB board or of metal. If the plate is heated, it will usually have a piece of glass held on top of it by bulldog clips. <br />
<br />
Tape is usually applied to the upper plate to act as a print surface. It helps the extruded plastic stick to the bed and it also makes it easier to remove the part once it's done. The two most common tape types used are blue painter's tape and kapton tape.<br />
<br />
==== Lower Plate ====<br />
Sometimes the lower plate is called the frog plate because the original mendel's lower plate kind of looked like a frog.<br />
<br />
It provides a sturdy base that the upper plate can be connected to. If the bed moves along one of the axes, then the lower plate is directly connected to the mechanism that moves the bed. For the Y axis, this usually means belts or for the Z axis, this usually means threaded rod.<br />
<br />
== Extruder ==<br />
: main article: [[:Category:Extruders]]<br />
<br />
The extruder is responsible for feeding [[filament]] through a nozzle and melting it as it's deposited onto the bed where the part is made.<br />
<br />
The extruder consists of two parts:<br />
# The cold end<br />
# The hot end<br />
<br />
Normally, the "Cold End" is connected to the "Hot End" across a thermal break or insulator. This has to be rigid and accurate enough to reliably pass the filament from one side to the other, but still prevent much of the heat transfer. The materials of choice are usually PEEK plastic with PTFE liners or PTFE with stainless steel mechanical supports or a combination of all three. <br />
<br />
However, there also exist [[Erik's_Bowden_Extruder|Bowden Extruders]] which separate the hot end from the cold end by a long tube. Bowden extruders are much faster because they are much lighter.<br />
<br />
==== Cold End ====<br />
This can get a bit confusing here People tend to refer to the cold end as an "extruder" also. In reality, it's only half of the entire extruder mechanism. The cold end is the part that mechanically feeds material to the hot end, which in turn melts it. <br />
<br />
Popular cold ends are:<br />
* [[Wade's Geared Extruder]]<br />
* [[Greg's Hinged Extruder]]<br />
* [http://www.thingiverse.com/thing:18379 Greg's Wade's Reloaded Extruder]<br />
<br />
==== Hot End ====<br />
: See also [[Hot End Design Theory]]<br />
<br />
The hot end is arguably the most complex aspect of 3d printers as it deals with the tricky business of melting and extruding plastic filament. In general, the hot end is a metal case with<br />
# A resistor or heater cartridge that heats up so it melts the plastic (usually around 200C) <br />
# A [[thermistor]] or a [[thermocouple]] which measures the temperature<br />
The electronics basically monitor the temperature via the thermistor, then raise or lower the temperature by varying the amount of power supplied usually by some form of [[Wikipedia:Pulse_width_modulation|PWM]]<br />
<br />
see Hotend comparison:<br />
[[Hot End Comparison]] and [[Hot End]]<br />
<br />
==== Filament ====<br />
Generally, people use one of two types of filament: ABS or PLA. ABS is strongly scented when melted and warps but is relatively strong whereas PLA is said to smell like waffles and is biodegradable. ABS fumes are detrimental to one's health. ABS will bend before it breaks whereas PLA is relatively brittle. Consequently, for delicate structural roles, PLA should be used, however, for other purposes, ABS can be ideal.<br />
<br />
=== Notes on PID ===<br />
Sometimes you will hear people talk about [[Wikipedia:PID_controller|PID]] when discussing extruders. PID is a closed-loop control algorithm that engineers have been using for years. It is a mathematical algorithm that uses feedback from sensors (measuring temperature, for example) and controls an output (such as switching a heater on and off) to reach and maintain the desired setpoint (the temperature you want the extruder to have, for example).<br />
<br />
Real world example: When you are driving your car down the highway, you're doing your own PID-like function as you watch the road and adjust the steering wheel to stay in your lane. If you adjust a little bit at a time and often enough, you stay in your lane nicely. But if you wait until you hit the lines on either side of the road before adjusting the wheel, people will think you're drunk and you'll oscillate all over the road. You may still get where you're going but it won't be pretty. PIDs use constants (numbers) that have to be tuned (adjusted) to the application. To continue the driving example, drunk is having bad constants, sober is just the right numbers. <br />
<br />
Cruise control in a car is another good example of an every day [[Wikipedia:PID_controller|PID]] controller.<br />
<br />
[[Category:RepRap machines| ]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189588G-code2022-04-21T07:16:29Z<p>Espr14: /* M109: Set Extruder Temperature and Wait */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
==== *: CRC====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*37428</code><br />
<br />
The 8-bit checksum provides insufficient protection against noise on the received data connection in some situations, for example where the cable from a display device runs close to an extruder cable. Therefore RepRapFirmware allows a CRC to be used in place of a checksum. If present, the CRC should be the last field in a line, but before a comment. RepRapFirmware assumes that * followed by 5 digits is a CRC, whereas * followed by 1, 2 or 3 digits is a checksum. The polynomial used is 0x1021 as for CCITT CRC16.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum (or CRC if supported).<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
:<code>P</code> Reserved by Prusa<br />
:<code>I</code> Reserved by Prusa<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.4+}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
Marlin 2.0.9.4 added <code>S</code> and <code>U</code> parameters to mount the SD Card or USB drive, respectively. Hosts can look for "<code>Cap:MULTI_VOLUME:1</code>".<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
:M36 filename.gco<br />
:M36<br />
<br />
Returns information in JSON format for the specified SD card file (if a filename was provided) or for the file currently being printed. A sample response is:<br />
<br />
:{"err":0,"size":436831,"fileName":"EscherLizardModified.gcode","lastModified":"2017-09-21T16:58:07","height":5.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. "printTime" is the printing time estimated by the slicer, "simulationTime" is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present. Versions of RepRapFirmware prior to 3.4 do not provide the "fileName" field if information for a specific file was requested.<br />
<br />
RepRapFirmware 3.4 and later also return information about thumbnail imaged embedded in the GCode file via an additional JSON field "thumbnails". A sample value for this field is:<br />
<br />
:"thumbnails":[{"width":32,"height":32,"fmt":"qoi","offset":103,"size":2140},{"width":220,"height":220,"fmt":"qoi","offset":2384,"size":25464}]<br />
<br />
The "fmt" field denotes the encoding of the thumbnail and is either "png" or "qoi". The "thumbnails" field is omitted entirely if there are no thumbnails embedded in the GCode file.<br />
<br />
==== M36.1: Return embedded thumbnail data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' Name of the GCode file from which thumbnail data is to be retrieved<br />
:'''Snnnn''' Byte offset into the file at which thumbnail data is to be fetched<br />
<br />
This command is used to return the data for an thumbnail image in a GCode file. The offset value should be either the offset of the start of data for a thumbnail as returned by the M36 command, or the value returned in the "next" field by a previous M36.1 command. The response is in JSON format. Here is a sample response:<br />
<br />
:{fileName":"EscherLizardModified.gcode","offset":103,"data":"cW9pZgAAACA....AAAAB","next":0,err": 0}<br />
<br />
The "fileName" and "offset" values are as given in the command. "data" is part or all of the base64-encoded thumbnail data starting at that offset. "next" is zero if there is no more data for that thumbnail, otherwise not all the thumbnail data was returned and "next" is the byte offset in the file of the rest of the thumbnail data. "err" is 0 if the command was successful, otherwise "err" is nonzero and the other fields may or may not be present.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 - 2.0.9.3 uses the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN. In Marlin 2.0.9.4 and up the <code>T</code> parameter is used instead.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Use fan for cooling (Only Prusa)<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Use fan for cooling (Only Prusa)<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
:<code>F</code> use extruder fan to speed up cooling (if not heating)<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
:<code>Vnnn</code> volume in rage 0 - 1<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Deploy Z Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' Probe number, default 0 (RepRapFirmware)<br />
: '''S''' Set BLTouch HS Mode (Marlin 2.0.9.3+ with <code>BLTOUCH</code> enabled.)<br />
: '''H''' Report current BLTouch HS Mode (Marlin 2.0.9.4+ with <code>BLTOUCH</code> enabled.)<br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Deploy the z-probe (if present). In RepRapFirmware this command runs the macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise it runs '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Stow Z Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M422: Set a G34 Point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.4+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single XY coordinate to be used by <code>G34</code> for Z Stepper Alignment.<br />
<br />
;Usage<br />
:<code>M422 S[index] X[pos] Y[pos]</code><br />
<br />
==== M423: X-Axis Twist Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.4+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Reset, set, or report X-Axis Twist Compensation data that will be used by subsequent <code>G29</code> commands to compensate for a twisted X-axis.<br />
<br />
;Parameters<br />
:<code>R</code> Flag to reset the X-twist data to configured defaults.<br />
:<code>X[index]</code> Zero-based index into the X-twist data array. (<code>Z</code> is also required)<br />
:<code>Z[offset]</code> An offset value to set. (<code>X</code> is also required)<br />
:<code>A[start]</code> Set the starting X position.<br />
:<code>I[spacing]</code> Set the X spacing distance.<br />
<br />
;Usage<br />
:<code>M423</code> to report the current X-twist data to the host console.<br />
:<code>M423 R</code> to reset X-twist data to the configured defaults.<br />
:<code>M423 X[index] Z[offset]</code> to set an offset value.<br />
:<code>M423 A[start] I[spacing]</code> to set the X-start position and X-spacing distance.<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M73}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm. Newer Hangprinters might use units of N.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake</code><br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M569.8: Read Axis Force ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.5 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
<br />
The readouts are in units of Newtons.<br />
<br />
;Example<br />
M569.8 P40.0:41.0:42.0:43.0<br />
<tt>[3.52, -0.60, 7.24, -5.84, ],</tt><br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter).<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.5 usually gives the best print quality. Direct drive extruders typically work best with lower values such as 0.05.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|3.3.0 and earlier}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
In RepRapFirmware 3.3.0 and later the heater PWM can be queried from the Object Model instead.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate (optional)<br />
:<code>Snnn</code> Protocol (optional)<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one.<br />
<br />
The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port).<br />
<br />
The <code>S</code> parameter is a bitmap of protocol features. Bit 0 if set specifies that only commands that include a valid checksum or CRC should be accepted from this comms channel. Bit 1 if set specifies that responses should be sent in raw mode (default is to send them as JSON). Bit 2 if set specifies that only commands with a valid CRC should be accepted (this overrides bit 0).<br />
<br />
If either the B or the S parameter is missing, the previous value will be retained, or a default used if the port has not previously been configured using M575. If both are missing then the existing values are reported.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M596: Select movement queue number ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.5+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Required movement queue number. Queues are numbered 0 (the default queue), 1, ...<br />
<br />
This command is supported in RepRapFirmware builds that can execute moves on different axis systems asynchronously, for example for concurrent printing of two or more different objects. It specifies that subsequent GCode commands should be routed to the specified movement queue and the tool associated with that queue.<br />
<br />
The number of available queues is firmware-dependent but will typically be 2. Before using a movement queue other than queue 0 it may be necessary to use M595 to increase the length of that queue, because the default length of movement queues other than the primary one may be quite short.<br />
<br />
At the start of a file print, queue 0 is selected automatically.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
:<code>N</code> (no return) Don't return to the previous position after filament change<br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M704: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M705: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M706: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M707: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M708: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M709: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''E"type"''' Event type name<br />
:'''Dnn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Pnn''' (optional) additional data about the event (unsigned integer)<br />
:'''Bnn''' (optional) CAN address that the event should appear to originate from<br />
:'''S"text"''' (optional) Short text string to be appended to the event message<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: heater_fault, driver_error, filament_error, driver_warning, driver_stall and mcu_temperature_warning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the local driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D20: Generate an offline crash dump =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Generate a crash dump for later retrival.''<br />
<br />
;Usage<br />
:<code>D20 [E]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
<br />
;Notes<br />
: A crash dump can be later recovered with D21, or cleared with D22.<br />
: An emergency crash dump includes register data, but will cause the printer to reset after the dump is completed.<br />
<br />
===== D21: Print crash dump to serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Output the complete crash dump (if present) to the serial.''<br />
<br />
;Usage<br />
:<code>D21</code><br />
<br />
;Notes<br />
: The starting address can vary between builds, but it's always at the beginning of the data section.<br />
<br />
===== D22: Clear crash dump state =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Clear an existing internal crash dump.''<br />
<br />
;Usage<br />
:<code>D22</code><br />
<br />
===== D23: Request emergency dump on serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''On boards without offline dump support, request online dumps to the serial port on firmware faults.''<br />
:''When online dumps are enabled, the FW will dump memory on the serial before resetting.''<br />
<br />
;Usage<br />
:<code>D23 [E] [R]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
:<code>R</code>: Disable online dumps.<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189587G-code2022-04-21T07:15:57Z<p>Espr14: /* M104: Set Extruder Temperature */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
==== *: CRC====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*37428</code><br />
<br />
The 8-bit checksum provides insufficient protection against noise on the received data connection in some situations, for example where the cable from a display device runs close to an extruder cable. Therefore RepRapFirmware allows a CRC to be used in place of a checksum. If present, the CRC should be the last field in a line, but before a comment. RepRapFirmware assumes that * followed by 5 digits is a CRC, whereas * followed by 1, 2 or 3 digits is a checksum. The polynomial used is 0x1021 as for CCITT CRC16.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum (or CRC if supported).<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
:<code>P</code> Reserved by Prusa<br />
:<code>I</code> Reserved by Prusa<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.4+}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
Marlin 2.0.9.4 added <code>S</code> and <code>U</code> parameters to mount the SD Card or USB drive, respectively. Hosts can look for "<code>Cap:MULTI_VOLUME:1</code>".<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
:M36 filename.gco<br />
:M36<br />
<br />
Returns information in JSON format for the specified SD card file (if a filename was provided) or for the file currently being printed. A sample response is:<br />
<br />
:{"err":0,"size":436831,"fileName":"EscherLizardModified.gcode","lastModified":"2017-09-21T16:58:07","height":5.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. "printTime" is the printing time estimated by the slicer, "simulationTime" is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present. Versions of RepRapFirmware prior to 3.4 do not provide the "fileName" field if information for a specific file was requested.<br />
<br />
RepRapFirmware 3.4 and later also return information about thumbnail imaged embedded in the GCode file via an additional JSON field "thumbnails". A sample value for this field is:<br />
<br />
:"thumbnails":[{"width":32,"height":32,"fmt":"qoi","offset":103,"size":2140},{"width":220,"height":220,"fmt":"qoi","offset":2384,"size":25464}]<br />
<br />
The "fmt" field denotes the encoding of the thumbnail and is either "png" or "qoi". The "thumbnails" field is omitted entirely if there are no thumbnails embedded in the GCode file.<br />
<br />
==== M36.1: Return embedded thumbnail data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' Name of the GCode file from which thumbnail data is to be retrieved<br />
:'''Snnnn''' Byte offset into the file at which thumbnail data is to be fetched<br />
<br />
This command is used to return the data for an thumbnail image in a GCode file. The offset value should be either the offset of the start of data for a thumbnail as returned by the M36 command, or the value returned in the "next" field by a previous M36.1 command. The response is in JSON format. Here is a sample response:<br />
<br />
:{fileName":"EscherLizardModified.gcode","offset":103,"data":"cW9pZgAAACA....AAAAB","next":0,err": 0}<br />
<br />
The "fileName" and "offset" values are as given in the command. "data" is part or all of the base64-encoded thumbnail data starting at that offset. "next" is zero if there is no more data for that thumbnail, otherwise not all the thumbnail data was returned and "next" is the byte offset in the file of the rest of the thumbnail data. "err" is 0 if the command was successful, otherwise "err" is nonzero and the other fields may or may not be present.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 - 2.0.9.3 uses the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN. In Marlin 2.0.9.4 and up the <code>T</code> parameter is used instead.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Use fan for cooling (Only Prusa)<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
:<code>F</code> use extruder fan to speed up cooling (if not heating)<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
:<code>Vnnn</code> volume in rage 0 - 1<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Deploy Z Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' Probe number, default 0 (RepRapFirmware)<br />
: '''S''' Set BLTouch HS Mode (Marlin 2.0.9.3+ with <code>BLTOUCH</code> enabled.)<br />
: '''H''' Report current BLTouch HS Mode (Marlin 2.0.9.4+ with <code>BLTOUCH</code> enabled.)<br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Deploy the z-probe (if present). In RepRapFirmware this command runs the macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise it runs '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Stow Z Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M422: Set a G34 Point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.4+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single XY coordinate to be used by <code>G34</code> for Z Stepper Alignment.<br />
<br />
;Usage<br />
:<code>M422 S[index] X[pos] Y[pos]</code><br />
<br />
==== M423: X-Axis Twist Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.4+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Reset, set, or report X-Axis Twist Compensation data that will be used by subsequent <code>G29</code> commands to compensate for a twisted X-axis.<br />
<br />
;Parameters<br />
:<code>R</code> Flag to reset the X-twist data to configured defaults.<br />
:<code>X[index]</code> Zero-based index into the X-twist data array. (<code>Z</code> is also required)<br />
:<code>Z[offset]</code> An offset value to set. (<code>X</code> is also required)<br />
:<code>A[start]</code> Set the starting X position.<br />
:<code>I[spacing]</code> Set the X spacing distance.<br />
<br />
;Usage<br />
:<code>M423</code> to report the current X-twist data to the host console.<br />
:<code>M423 R</code> to reset X-twist data to the configured defaults.<br />
:<code>M423 X[index] Z[offset]</code> to set an offset value.<br />
:<code>M423 A[start] I[spacing]</code> to set the X-start position and X-spacing distance.<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M73}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm. Newer Hangprinters might use units of N.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake</code><br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M569.8: Read Axis Force ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.5 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
<br />
The readouts are in units of Newtons.<br />
<br />
;Example<br />
M569.8 P40.0:41.0:42.0:43.0<br />
<tt>[3.52, -0.60, 7.24, -5.84, ],</tt><br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter).<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.5 usually gives the best print quality. Direct drive extruders typically work best with lower values such as 0.05.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|3.3.0 and earlier}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
In RepRapFirmware 3.3.0 and later the heater PWM can be queried from the Object Model instead.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate (optional)<br />
:<code>Snnn</code> Protocol (optional)<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one.<br />
<br />
The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port).<br />
<br />
The <code>S</code> parameter is a bitmap of protocol features. Bit 0 if set specifies that only commands that include a valid checksum or CRC should be accepted from this comms channel. Bit 1 if set specifies that responses should be sent in raw mode (default is to send them as JSON). Bit 2 if set specifies that only commands with a valid CRC should be accepted (this overrides bit 0).<br />
<br />
If either the B or the S parameter is missing, the previous value will be retained, or a default used if the port has not previously been configured using M575. If both are missing then the existing values are reported.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M596: Select movement queue number ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.5+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Required movement queue number. Queues are numbered 0 (the default queue), 1, ...<br />
<br />
This command is supported in RepRapFirmware builds that can execute moves on different axis systems asynchronously, for example for concurrent printing of two or more different objects. It specifies that subsequent GCode commands should be routed to the specified movement queue and the tool associated with that queue.<br />
<br />
The number of available queues is firmware-dependent but will typically be 2. Before using a movement queue other than queue 0 it may be necessary to use M595 to increase the length of that queue, because the default length of movement queues other than the primary one may be quite short.<br />
<br />
At the start of a file print, queue 0 is selected automatically.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
:<code>N</code> (no return) Don't return to the previous position after filament change<br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M704: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M705: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M706: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M707: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M708: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M709: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''E"type"''' Event type name<br />
:'''Dnn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Pnn''' (optional) additional data about the event (unsigned integer)<br />
:'''Bnn''' (optional) CAN address that the event should appear to originate from<br />
:'''S"text"''' (optional) Short text string to be appended to the event message<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: heater_fault, driver_error, filament_error, driver_warning, driver_stall and mcu_temperature_warning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the local driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D20: Generate an offline crash dump =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Generate a crash dump for later retrival.''<br />
<br />
;Usage<br />
:<code>D20 [E]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
<br />
;Notes<br />
: A crash dump can be later recovered with D21, or cleared with D22.<br />
: An emergency crash dump includes register data, but will cause the printer to reset after the dump is completed.<br />
<br />
===== D21: Print crash dump to serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Output the complete crash dump (if present) to the serial.''<br />
<br />
;Usage<br />
:<code>D21</code><br />
<br />
;Notes<br />
: The starting address can vary between builds, but it's always at the beginning of the data section.<br />
<br />
===== D22: Clear crash dump state =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Clear an existing internal crash dump.''<br />
<br />
;Usage<br />
:<code>D22</code><br />
<br />
===== D23: Request emergency dump on serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''On boards without offline dump support, request online dumps to the serial port on firmware faults.''<br />
:''When online dumps are enabled, the FW will dump memory on the serial before resetting.''<br />
<br />
;Usage<br />
:<code>D23 [E] [R]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
:<code>R</code>: Disable online dumps.<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189586G-code2022-04-21T07:13:55Z<p>Espr14: /* M104: Set Extruder Temperature */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
==== *: CRC====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*37428</code><br />
<br />
The 8-bit checksum provides insufficient protection against noise on the received data connection in some situations, for example where the cable from a display device runs close to an extruder cable. Therefore RepRapFirmware allows a CRC to be used in place of a checksum. If present, the CRC should be the last field in a line, but before a comment. RepRapFirmware assumes that * followed by 5 digits is a CRC, whereas * followed by 1, 2 or 3 digits is a checksum. The polynomial used is 0x1021 as for CCITT CRC16.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum (or CRC if supported).<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
:<code>P</code> Reserved by Prusa<br />
:<code>I</code> Reserved by Prusa<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.4+}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
Marlin 2.0.9.4 added <code>S</code> and <code>U</code> parameters to mount the SD Card or USB drive, respectively. Hosts can look for "<code>Cap:MULTI_VOLUME:1</code>".<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
:M36 filename.gco<br />
:M36<br />
<br />
Returns information in JSON format for the specified SD card file (if a filename was provided) or for the file currently being printed. A sample response is:<br />
<br />
:{"err":0,"size":436831,"fileName":"EscherLizardModified.gcode","lastModified":"2017-09-21T16:58:07","height":5.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. "printTime" is the printing time estimated by the slicer, "simulationTime" is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present. Versions of RepRapFirmware prior to 3.4 do not provide the "fileName" field if information for a specific file was requested.<br />
<br />
RepRapFirmware 3.4 and later also return information about thumbnail imaged embedded in the GCode file via an additional JSON field "thumbnails". A sample value for this field is:<br />
<br />
:"thumbnails":[{"width":32,"height":32,"fmt":"qoi","offset":103,"size":2140},{"width":220,"height":220,"fmt":"qoi","offset":2384,"size":25464}]<br />
<br />
The "fmt" field denotes the encoding of the thumbnail and is either "png" or "qoi". The "thumbnails" field is omitted entirely if there are no thumbnails embedded in the GCode file.<br />
<br />
==== M36.1: Return embedded thumbnail data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' Name of the GCode file from which thumbnail data is to be retrieved<br />
:'''Snnnn''' Byte offset into the file at which thumbnail data is to be fetched<br />
<br />
This command is used to return the data for an thumbnail image in a GCode file. The offset value should be either the offset of the start of data for a thumbnail as returned by the M36 command, or the value returned in the "next" field by a previous M36.1 command. The response is in JSON format. Here is a sample response:<br />
<br />
:{fileName":"EscherLizardModified.gcode","offset":103,"data":"cW9pZgAAACA....AAAAB","next":0,err": 0}<br />
<br />
The "fileName" and "offset" values are as given in the command. "data" is part or all of the base64-encoded thumbnail data starting at that offset. "next" is zero if there is no more data for that thumbnail, otherwise not all the thumbnail data was returned and "next" is the byte offset in the file of the rest of the thumbnail data. "err" is 0 if the command was successful, otherwise "err" is nonzero and the other fields may or may not be present.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 - 2.0.9.3 uses the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN. In Marlin 2.0.9.4 and up the <code>T</code> parameter is used instead.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Cnnn</code> Use fan for cooling (Only Prusa)<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
:<code>F</code> use extruder fan to speed up cooling (if not heating)<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
:<code>Vnnn</code> volume in rage 0 - 1<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Deploy Z Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' Probe number, default 0 (RepRapFirmware)<br />
: '''S''' Set BLTouch HS Mode (Marlin 2.0.9.3+ with <code>BLTOUCH</code> enabled.)<br />
: '''H''' Report current BLTouch HS Mode (Marlin 2.0.9.4+ with <code>BLTOUCH</code> enabled.)<br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Deploy the z-probe (if present). In RepRapFirmware this command runs the macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise it runs '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Stow Z Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M422: Set a G34 Point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.4+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single XY coordinate to be used by <code>G34</code> for Z Stepper Alignment.<br />
<br />
;Usage<br />
:<code>M422 S[index] X[pos] Y[pos]</code><br />
<br />
==== M423: X-Axis Twist Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.4+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Reset, set, or report X-Axis Twist Compensation data that will be used by subsequent <code>G29</code> commands to compensate for a twisted X-axis.<br />
<br />
;Parameters<br />
:<code>R</code> Flag to reset the X-twist data to configured defaults.<br />
:<code>X[index]</code> Zero-based index into the X-twist data array. (<code>Z</code> is also required)<br />
:<code>Z[offset]</code> An offset value to set. (<code>X</code> is also required)<br />
:<code>A[start]</code> Set the starting X position.<br />
:<code>I[spacing]</code> Set the X spacing distance.<br />
<br />
;Usage<br />
:<code>M423</code> to report the current X-twist data to the host console.<br />
:<code>M423 R</code> to reset X-twist data to the configured defaults.<br />
:<code>M423 X[index] Z[offset]</code> to set an offset value.<br />
:<code>M423 A[start] I[spacing]</code> to set the X-start position and X-spacing distance.<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M73}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm. Newer Hangprinters might use units of N.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake</code><br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M569.8: Read Axis Force ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.5 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
<br />
The readouts are in units of Newtons.<br />
<br />
;Example<br />
M569.8 P40.0:41.0:42.0:43.0<br />
<tt>[3.52, -0.60, 7.24, -5.84, ],</tt><br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter).<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.5 usually gives the best print quality. Direct drive extruders typically work best with lower values such as 0.05.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|3.3.0 and earlier}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
In RepRapFirmware 3.3.0 and later the heater PWM can be queried from the Object Model instead.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate (optional)<br />
:<code>Snnn</code> Protocol (optional)<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one.<br />
<br />
The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port).<br />
<br />
The <code>S</code> parameter is a bitmap of protocol features. Bit 0 if set specifies that only commands that include a valid checksum or CRC should be accepted from this comms channel. Bit 1 if set specifies that responses should be sent in raw mode (default is to send them as JSON). Bit 2 if set specifies that only commands with a valid CRC should be accepted (this overrides bit 0).<br />
<br />
If either the B or the S parameter is missing, the previous value will be retained, or a default used if the port has not previously been configured using M575. If both are missing then the existing values are reported.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M596: Select movement queue number ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.5+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Required movement queue number. Queues are numbered 0 (the default queue), 1, ...<br />
<br />
This command is supported in RepRapFirmware builds that can execute moves on different axis systems asynchronously, for example for concurrent printing of two or more different objects. It specifies that subsequent GCode commands should be routed to the specified movement queue and the tool associated with that queue.<br />
<br />
The number of available queues is firmware-dependent but will typically be 2. Before using a movement queue other than queue 0 it may be necessary to use M595 to increase the length of that queue, because the default length of movement queues other than the primary one may be quite short.<br />
<br />
At the start of a file print, queue 0 is selected automatically.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
:<code>N</code> (no return) Don't return to the previous position after filament change<br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M704: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M705: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M706: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M707: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M708: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M709: Filament/MMU related gcode in development (reserve) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
This gcode is in development by Prusa Research related to Filament and MMU settings/operations and will be updated as soon as possible.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''E"type"''' Event type name<br />
:'''Dnn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Pnn''' (optional) additional data about the event (unsigned integer)<br />
:'''Bnn''' (optional) CAN address that the event should appear to originate from<br />
:'''S"text"''' (optional) Short text string to be appended to the event message<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: heater_fault, driver_error, filament_error, driver_warning, driver_stall and mcu_temperature_warning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the local driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D20: Generate an offline crash dump =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Generate a crash dump for later retrival.''<br />
<br />
;Usage<br />
:<code>D20 [E]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
<br />
;Notes<br />
: A crash dump can be later recovered with D21, or cleared with D22.<br />
: An emergency crash dump includes register data, but will cause the printer to reset after the dump is completed.<br />
<br />
===== D21: Print crash dump to serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Output the complete crash dump (if present) to the serial.''<br />
<br />
;Usage<br />
:<code>D21</code><br />
<br />
;Notes<br />
: The starting address can vary between builds, but it's always at the beginning of the data section.<br />
<br />
===== D22: Clear crash dump state =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Clear an existing internal crash dump.''<br />
<br />
;Usage<br />
:<code>D22</code><br />
<br />
===== D23: Request emergency dump on serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''On boards without offline dump support, request online dumps to the serial port on firmware faults.''<br />
:''When online dumps are enabled, the FW will dump memory on the serial before resetting.''<br />
<br />
;Usage<br />
:<code>D23 [E] [R]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
:<code>R</code>: Disable online dumps.<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189452G-code2022-01-12T19:20:43Z<p>Espr14: /* M600: Filament change pause */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum.<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
:M36 filename.gco<br />
:M36<br />
<br />
Returns information in JSON format for the specified SD card file (if a filename was provided) or for the file currently being printed. A sample response is:<br />
<br />
:{"err":0,"size":436831,"fileName":"EscherLizardModified.gcode","lastModified":"2017-09-21T16:58:07","height":5.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. "printTime" is the printing time estimated by the slicer, "simulationTime" is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present. Versions of RepRapFirmware prior to 3.4 do not provide the "fileName" field if information for a specific file was requested.<br />
<br />
RepRapFirmware 3.4 and later also return information about thumbnail imaged embedded in the GCode file via an additional JSON field "thumbnails". A sample value for this field is:<br />
<br />
:"thumbnails":[{"width":32,"height":32,"fmt":"qoi","offset":103,"size":2140},{"width":220,"height":220,"fmt":"qoi","offset":2384,"size":25464}]<br />
<br />
The "fmt" field denotes the encoding of the thumbnail and is either "png" or "qoi". The "thumbnails" field is omitted entirely if there are no thumbnails embedded in the GCode file.<br />
<br />
==== M36.1: Return embedded thumbnail data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' Name of the GCode file from which thumbnail data is to be retrieved<br />
:'''Snnnn''' Byte offset into the file at which thumbnail data is to be fetched<br />
<br />
This command is used to return the data for an thumbnail image in a GCode file. The offset value should be either the offset of the start of data for a thumbnail as returned by the M36 command, or the value returned in the "next" field by a previous M36.1 command. The response is in JSON format. Here is a sample response:<br />
<br />
:{fileName":"EscherLizardModified.gcode","offset":103,"data":"cW9pZgAAACA....AAAAB","next":0,err": 0}<br />
<br />
The "fileName" and "offset" values are as given in the command. "data" is part or all of the base64-encoded thumbnail data starting at that offset. "next" is zero if there is no more data for that thumbnail, otherwise not all the thumbnail data was returned and "next" is the byte offset in the file of the rest of the thumbnail data. "err" is 0 if the command was successful, otherwise "err" is nonzero and the other fields may or may not be present.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 and up include the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
:<code>F</code> use extruder fan to speed up cooling (if not heating)<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
:<code>Vnnn</code> volume in rage 0 - 1<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Lower z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Lower z-probe if present. In RepRapFirmware this runs macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Raise z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.x+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake<br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter). Supported by RepRapFirmware-dc42, -ch and -dn.<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.2 usually gives the best print quality.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate<br />
:<code>Snnn</code> Whether checksums should be used<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one. The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port). The <code>S</code> parameter is a bitmap of features. The lowest bit, if set, specifies that only commands that include a valid checksum should be accepted from this comms channel.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
:<code>N</code> (no return) Don't return to the previous position after filament change<br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''E"type"''' Event type name<br />
:'''Dnn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Pnn''' (optional) additional data about the event (unsigned integer)<br />
:'''Bnn''' (optional) CAN address that the event should appear to originate from<br />
:'''S"text"''' (optional) Short text string to be appended to the event message<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: heater_fault, driver_error, filament_error, driver_warning, driver_stall and mcu_temperature_warning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the local driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D20: Generate an offline crash dump =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Generate a crash dump for later retrival.''<br />
<br />
;Usage<br />
:<code>D20 [E]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
<br />
;Notes<br />
: A crash dump can be later recovered with D21, or cleared with D22.<br />
: An emergency crash dump includes register data, but will cause the printer to reset after the dump is completed.<br />
<br />
===== D21: Print crash dump to serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Output the complete crash dump (if present) to the serial.''<br />
<br />
;Usage<br />
:<code>D21</code><br />
<br />
;Notes<br />
: The starting address can vary between builds, but it's always at the beginning of the data section.<br />
<br />
===== D22: Clear crash dump state =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Clear an existing internal crash dump.''<br />
<br />
;Usage<br />
:<code>D22</code><br />
<br />
===== D23: Request emergency dump on serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''On boards without offline dump support, request online dumps to the serial port on firmware faults.''<br />
:''When online dumps are enabled, the FW will dump memory on the serial before resetting.''<br />
<br />
;Usage<br />
:<code>D23 [E] [R]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
:<code>R</code>: Disable online dumps.<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189447G-code2022-01-04T19:02:28Z<p>Espr14: /* M109: Set Extruder Temperature and Wait */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum.<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M36 filename.gco<br />
<br />
Returns information for the specified SD card file in JSON format. A sample response is:<br />
<br />
{"err":0,"size":436831,"lastModified":"2017-09-21T16:58:07","height":5.20,"firstLayerHeight":0.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. 'printTime' is the printing time estimated by the slicer, 'simulationTime' is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present.<br />
<br />
If the file name parameter is not supplied and a file on the SD card is currently being printed, then information for that file is returned including additional field "fileName". This feature is used by the web interface and by PanelDue, so that if a connection is made when a file is already being printed, the name and other information about that file can be shown.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 and up include the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
:<code>F</code> use extruder fan to speed up cooling (if not heating)<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
:<code>Vnnn</code> volume in rage 0 - 1<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Lower z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Lower z-probe if present. In RepRapFirmware this runs macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Raise z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.x+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake<br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter). Supported by RepRapFirmware-dc42, -ch and -dn.<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.2 usually gives the best print quality.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate<br />
:<code>Snnn</code> Whether checksums should be used<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one. The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port). The <code>S</code> parameter is a bitmap of features. The lowest bit, if set, specifies that only commands that include a valid checksum should be accepted from this comms channel.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''E"type"''' Event type name<br />
:'''Dnn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Pnn''' (optional) additional data about the event (unsigned integer)<br />
:'''Bnn''' (optional) CAN address that the event should appear to originate from<br />
:'''S"text"''' (optional) Short text string to be appended to the event message<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: heater_fault, driver_error, filament_error, driver_warning, driver_stall and mcu_temperature_warning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the local driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D20: Generate an offline crash dump =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Generate a crash dump for later retrival.''<br />
<br />
;Usage<br />
:<code>D20 [E]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
<br />
;Notes<br />
: A crash dump can be later recovered with D21, or cleared with D22.<br />
: An emergency crash dump includes register data, but will cause the printer to reset after the dump is completed.<br />
<br />
===== D21: Print crash dump to serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Output the complete crash dump (if present) to the serial.''<br />
<br />
;Usage<br />
:<code>D21</code><br />
<br />
;Notes<br />
: The starting address can vary between builds, but it's always at the beginning of the data section.<br />
<br />
===== D22: Clear crash dump state =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Clear an existing internal crash dump.''<br />
<br />
;Usage<br />
:<code>D22</code><br />
<br />
===== D23: Request emergency dump on serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''On boards without offline dump support, request online dumps to the serial port on firmware faults.''<br />
:''When online dumps are enabled, the FW will dump memory on the serial before resetting.''<br />
<br />
;Usage<br />
:<code>D23 [E] [R]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
:<code>R</code>: Disable online dumps.<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189446G-code2022-01-04T19:01:59Z<p>Espr14: /* M109: Set Extruder Temperature and Wait */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum.<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M36 filename.gco<br />
<br />
Returns information for the specified SD card file in JSON format. A sample response is:<br />
<br />
{"err":0,"size":436831,"lastModified":"2017-09-21T16:58:07","height":5.20,"firstLayerHeight":0.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. 'printTime' is the printing time estimated by the slicer, 'simulationTime' is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present.<br />
<br />
If the file name parameter is not supplied and a file on the SD card is currently being printed, then information for that file is returned including additional field "fileName". This feature is used by the web interface and by PanelDue, so that if a connection is made when a file is already being printed, the name and other information about that file can be shown.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 and up include the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
:<code>F</code> use fan to speed up cooling (if not heating)<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
:<code>Vnnn</code> volume in rage 0 - 1<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Lower z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Lower z-probe if present. In RepRapFirmware this runs macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Raise z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.x+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake<br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter). Supported by RepRapFirmware-dc42, -ch and -dn.<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.2 usually gives the best print quality.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate<br />
:<code>Snnn</code> Whether checksums should be used<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one. The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port). The <code>S</code> parameter is a bitmap of features. The lowest bit, if set, specifies that only commands that include a valid checksum should be accepted from this comms channel.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''E"type"''' Event type name<br />
:'''Dnn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Pnn''' (optional) additional data about the event (unsigned integer)<br />
:'''Bnn''' (optional) CAN address that the event should appear to originate from<br />
:'''S"text"''' (optional) Short text string to be appended to the event message<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: heater_fault, driver_error, filament_error, driver_warning, driver_stall and mcu_temperature_warning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the local driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D20: Generate an offline crash dump =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Generate a crash dump for later retrival.''<br />
<br />
;Usage<br />
:<code>D20 [E]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
<br />
;Notes<br />
: A crash dump can be later recovered with D21, or cleared with D22.<br />
: An emergency crash dump includes register data, but will cause the printer to reset after the dump is completed.<br />
<br />
===== D21: Print crash dump to serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Output the complete crash dump (if present) to the serial.''<br />
<br />
;Usage<br />
:<code>D21</code><br />
<br />
;Notes<br />
: The starting address can vary between builds, but it's always at the beginning of the data section.<br />
<br />
===== D22: Clear crash dump state =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Clear an existing internal crash dump.''<br />
<br />
;Usage<br />
:<code>D22</code><br />
<br />
===== D23: Request emergency dump on serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''On boards without offline dump support, request online dumps to the serial port on firmware faults.''<br />
:''When online dumps are enabled, the FW will dump memory on the serial before resetting.''<br />
<br />
;Usage<br />
:<code>D23 [E] [R]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
:<code>R</code>: Disable online dumps.<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189445G-code2022-01-04T16:31:24Z<p>Espr14: /* M300: Play beep sound */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum.<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M36 filename.gco<br />
<br />
Returns information for the specified SD card file in JSON format. A sample response is:<br />
<br />
{"err":0,"size":436831,"lastModified":"2017-09-21T16:58:07","height":5.20,"firstLayerHeight":0.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. 'printTime' is the printing time estimated by the slicer, 'simulationTime' is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present.<br />
<br />
If the file name parameter is not supplied and a file on the SD card is currently being printed, then information for that file is returned including additional field "fileName". This feature is used by the web interface and by PanelDue, so that if a connection is made when a file is already being printed, the name and other information about that file can be shown.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 and up include the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
:<code>Vnnn</code> volume in rage 0 - 1<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Lower z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Lower z-probe if present. In RepRapFirmware this runs macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Raise z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.x+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake<br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter). Supported by RepRapFirmware-dc42, -ch and -dn.<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.2 usually gives the best print quality.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate<br />
:<code>Snnn</code> Whether checksums should be used<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one. The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port). The <code>S</code> parameter is a bitmap of features. The lowest bit, if set, specifies that only commands that include a valid checksum should be accepted from this comms channel.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''E"type"''' Event type name<br />
:'''Dnn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Pnn''' (optional) additional data about the event (unsigned integer)<br />
:'''Bnn''' (optional) CAN address that the event should appear to originate from<br />
:'''S"text"''' (optional) Short text string to be appended to the event message<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: heater_fault, driver_error, filament_error, driver_warning, driver_stall and mcu_temperature_warning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the local driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D20: Generate an offline crash dump =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Generate a crash dump for later retrival.''<br />
<br />
;Usage<br />
:<code>D20 [E]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
<br />
;Notes<br />
: A crash dump can be later recovered with D21, or cleared with D22.<br />
: An emergency crash dump includes register data, but will cause the printer to reset after the dump is completed.<br />
<br />
===== D21: Print crash dump to serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Output the complete crash dump (if present) to the serial.''<br />
<br />
;Usage<br />
:<code>D21</code><br />
<br />
;Notes<br />
: The starting address can vary between builds, but it's always at the beginning of the data section.<br />
<br />
===== D22: Clear crash dump state =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Clear an existing internal crash dump.''<br />
<br />
;Usage<br />
:<code>D22</code><br />
<br />
===== D23: Request emergency dump on serial =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''On boards without offline dump support, request online dumps to the serial port on firmware faults.''<br />
:''When online dumps are enabled, the FW will dump memory on the serial before resetting.''<br />
<br />
;Usage<br />
:<code>D23 [E] [R]</code><br />
<br />
;Parameters<br />
:<code>E</code>: Perform an emergency crash dump (resets the printer).<br />
:<code>R</code>: Disable online dumps.<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189408G-code2021-11-29T22:01:04Z<p>Espr14: /* M413: Power-Loss Recovery */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum.<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M36 filename.gco<br />
<br />
Returns information for the specified SD card file in JSON format. A sample response is:<br />
<br />
{"err":0,"size":436831,"lastModified":"2017-09-21T16:58:07","height":5.20,"firstLayerHeight":0.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. 'printTime' is the printing time estimated by the slicer, 'simulationTime' is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present.<br />
<br />
If the file name parameter is not supplied and a file on the SD card is currently being printed, then information for that file is returned including additional field "fileName". This feature is used by the web interface and by PanelDue, so that if a connection is made when a file is already being printed, the name and other information about that file can be shown.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 and up include the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Lower z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Lower z-probe if present. In RepRapFirmware this runs macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Raise z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.x+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake<br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter). Supported by RepRapFirmware-dc42, -ch and -dn.<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.2 usually gives the best print quality.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate<br />
:<code>Snnn</code> Whether checksums should be used<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one. The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port). The <code>S</code> parameter is a bitmap of features. The lowest bit, if set, specifies that only commands that include a valid checksum should be accepted from this comms channel.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''S"type"''' Event type name<br />
:'''Pnn''' or '''Pbb.nn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Rnn''' Optional additional data about the event (unsigned integer)<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: mainBoardPowerFail, heaterFault, driverError, filamentError, driverWarning, mcuTemperatureWarning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=189407G-code2021-11-29T22:00:36Z<p>Espr14: /* M412: Disable Filament Runout Detection */</p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, some gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].min+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum.<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode. Properties from the firmware object model (e.g. current position, current tool) can be included in controlling expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, other <code>Hnnn</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/min<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/min<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/min, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/min<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/min<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/min, then do the same move, but accelerating to 3000 mm/min. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1. H3 may be used to measure axis lengths and H4 can be used to stop when an endstop is hit while updating the position only (H4 is supported in 3.2-b4 and later).<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Lnnn Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode <sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 L1 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets. (Not supported on all firmwares).<br />
<br />
<sup>5</sup>L1 sets the offsets of the specified tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates. NOTE on some firmwares L is required (and is required by NIST standard). P is also required to specify either the tool to update or the WCS to update.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{yes|G18 and G19 need RRF 3.3 or later}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G10}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G11}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G27: Park toolhead ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Park the toolhead (i.e., nozzle) at a predefined XY position, with a Z raise value that applies over 0 or over the current position depending on the <code>P</code> parameter.<br />
<br />
In Marlin this G-code is enabled by <code>NOZZLE_PARK_FEATURE</code> and the park position is defined by <code>NOZZLE_PARK_POINT</code>. See [https://marlinfw.org/docs/gcode/G027.html G27 Park Toolhead] for details.<br />
<br />
;Usage<br />
G27 P0 ; Park, raising Z by NOZZLE_PARK_Z_RAISE_MIN, using NOZZLE_PARK_POINT.z as a safe height over 0<br />
G27 P1 ; Park, raising Z to at least NOZZLE_PARK_POINT.z over 0<br />
G27 P2 ; Park, raising Z by NOZZLE_PARK_POINT.z over the current Z<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
In RepRapFirmware 3.2 and later, G29 runs macro file mesh.g if it exists, otherwise it behaves like G29 S0. The mesh.g file can perform other actions (e.g. homing or tool selection) and then use G29 S0 to do the probing.<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient(s) of trigger height<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature such as PINDA. RepRapFirmware 3.1 and later allow both first and second order temperature coefficients to be specified, e.g. C0.015:0.001.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E O Rx.xx</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
:<code>O</code> Do not probe at the required kinematic points but at positions offseted to the probe-offsets <sup>1</sup> <br />
:<code>R</code> Temporary reduce the size of the probe grid by the specified amount (mm) <sup>1</sup><br />
<br />
;Notes<br />
<sup>1</sup> since 2.0.9.2<br />
<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Monitors probe input while moving linearly towards the specified coordinates, stopping upon detecting contact or reaching specified coordinates.<br />
<br />
;Usage<br />
:<code>G38.2 Xnnn Ynnn Znnn Fnnn</code><br />
;Parameters<br />
:<code>Xnnn</code> target X coordinate<br />
:<code>Ynnn</code> target Y coordinate<br />
:<code>Znnn</code> target Z coordinate<br />
:<code>Fnnn</code> Feedrate in mm/min<br />
;Example<br />
G38.2 Z0<br />
G38.2 X50<br />
G38.2 Z10 Y10<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/min)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G68: Coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G68 Xnnn Ynnn Rnnnn [I]</code><br />
:<code>G68 Annn Bnnn Rnnnn [I]</code><br />
;Parameters<br />
:<code>Xnnn, Ynnn...</code> Centre coordinates to rotate about<br />
:<code>Annn</code> first centre coordinate in the selected plane (e.g. equivalent to Xnnn if the selected plane is XY)<br />
:<code>Bnnn</code> second centre coordinate in the selected plane (e.g. equivalent to Ynnn if the selected plane is XY)<br />
:<code>Rnnn</code> angle to rotate in degrees. Positive angles rotate anticlockwise when viewing the selected plane from above.<br />
:<code>I</code> if this parameter is present, the R parameter is added to the existing rotation instead of being absolute<br />
<br />
Rotates the coordinate system in the current plane as selected by G17, G18 or G19. You may either specify the coordinates of the two axes of the selected plan (e.g. X and Y if using the default XY plane or after G17) or you may specify A and B coordinates.<br />
<br />
RepRapFirmware implements G68 for the XY plane only.<br />
<br />
==== G69: Cancel coordinate rotation ====<br />
{{Firmware Support | reprapfirmware={{yes|3.4 and later}} }}<br />
<br />
;Usage<br />
:<code>G69</code><br />
<br />
This cancels any coordinate rotation that was set up by G68.<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{partial|G30}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
M1 Hello world <sup>1</sup> <br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin does the same as <code>M0</code>.<br />
<br />
In Prusa 8-bit Firmware <sup>1</sup> the <code>M1 </code> needs at least a ''space'' behind the command to be executed correctly. It can be used the same as <code>M0 P<ms></code> or <code>M0 S<seconds></code> but will ignore the following "message".<br />
<br />
;Prusa Firmware 8-bit example<br />
<code>M1 S5</code> will wait for 5 seconds and show in the LCD status line "Waiting for user..." the same as <code>M0 S5</code><br />
<code>M1 Hello world</code> will show in the LCD status line "Hello world" and wait until the user press the LCD knob.<br />
<br />
<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>4</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Rnnn</code> File number to start at<sup>1</sup><br />
:<code>P"ddd"</code> Directory to list<sup>2</sup><br />
:<code>L</code> Reports long filenames instead of just short filenames. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
:<code>T</code> Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20).<sup>4</sup><br />
<br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
M20 L <sup>4</sup><br />
M20 T <sup>4</sup><br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
Please note that a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
The file size may be appended as an integer representing the size in bytes:<br />
<br />
Begin file list:<br />
SQUARE.G 1234<br />
ZCARRI~2.GCO 234<br />
End file list <br />
ok<br />
<br />
At least OctoPrint also supports an additional format showing the file's long name (see also M33) after the size:<br />
<br />
Begin file list:<br />
SQUARE.G 1234 SQUARE.G<br />
ZCARRI~2.GCO 234 ZCARRIAGE_V2.GCO<br />
End file list <br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list (or as much as can be fitted in the output buffer) is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir". The optional R parameter is the file number to start at, default 0. The JSON response also returns value "next" which is the number of the first file that wasn't returned, or 0 if all files were returned. The caller can enumerate all files even if there are very many by making successive M20 S2 calls with each call using R from the "next" value in the previous response, util "next" is zero.<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","first":0,"files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"],"next":0}<br />
<br />
;Example for <code>M20 L</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 "LFN file.gcode"<br />
End file list<br />
<br />
;Example for <code>M20 L T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00 "TEST1.GCO"<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08 "LFN file.gcode"<br />
End file list<br />
<br />
<br />
;Example for <code>M20 T</code><sup>4</sup><br />
Begin file list<br />
TEST1.GCO 1234 0x52936b00<br />
DIR_ENTER: /TESTFO~1/ "test folder"<br />
DIR_EXIT<br />
LFNFIL~1.GCO 56789 0x52936b08<br />
End file list<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
<sup>4</sup>The timestamp is a combination of both the date and time into a single integer and printed as a hex.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
Example input:<br />
<br />
M33 miscel~1/armchair/armcha~1.gco<br />
<br />
Example output: <br />
<br />
/Miscellaneous/Armchair/Armchair.gcode<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M36 filename.gco<br />
<br />
Returns information for the specified SD card file in JSON format. A sample response is:<br />
<br />
{"err":0,"size":436831,"lastModified":"2017-09-21T16:58:07","height":5.20,"firstLayerHeight":0.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. 'printTime' is the printing time estimated by the slicer, 'simulationTime' is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present.<br />
<br />
If the file name parameter is not supplied and a file on the SD card is currently being printed, then information for that file is returned including additional field "fileName". This feature is used by the web interface and by PanelDue, so that if a connection is made when a file is already being printed, the name and other information about that file can be shown.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use macro file M40.g}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 and up include the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{partial|Use macro M48.g}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no|M117}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{yes|3.3 and later}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware shows percent done, time remaining and time to change/pause/user interaction.<br />
;Usage<br />
<code>M73 P R Q S C<sup>1</sup> D<sup>1</sup></code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode (minutes)<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode (minutes)<br />
:<code>C</code> Time to change/pause/user interaction in normal mode (minutes)<sup>1</sup><br />
:<code>D</code> Time to change/pause/user interaction in silent mode (minutes)<sup>1</sup><br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
Prusa Firmware 3.10.0+<sup>1</sup><br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----; Change in mins: -----"<sup>1</sup><br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C"port_name"</code> (RepRapFirmware 3.4 and later only) Name of the pin used to control the power supply, default "pson"<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
M80 C"!pson" ; invert the PS_ON output for Meanwell power supplies<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M87: Cancel Safety Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | klipper={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M87</code><br />
<br />
Cancels the safety timer. Equivalent to <code>M86 S0</code>.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | klipper={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug Stepper drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about L6470 or Trinamic stepper drivers having a UART or SPI interface.<br />
<br />
With Trinamic drivers there are some extra parameters, and depending on the configuration either basic or detailed information will be reported. Use parameters <code>X</code>, <code>Y</code>, <code>Z</code>, etc. to limit the report only to the specified steppers, otherwise all steppers are reported. Pass <code>I</code> to re-initialize the drivers. Use parameter <code>S</code> to sample at regular intervals. The <code>P</code> parameter can be used to set the sample interval in milliseconds.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap, Prusa & Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>2</sup> | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending a <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
Sending a <code>M123</code> is used in Prusa firmware to report fan speeds and fan pwm values.<sup>1</sup><br />
<br />
Sending a <code>M123</code> is used in Marlin firmware to report only extruders fans speeds and pwm values.<sup>2</sup><br />
<br />
;Usage<br />
M123<br />
<br />
;Parameters<sup>2</sup><br />
:<code>Sn</code> autoreport every n seconds (0 to disable)<br />
<br />
<br />
;Prusa firmware output<sup>1</sup>:<br />
:<code>E0: - Hotend fan speed in RPM</code><br />
:<code>PRN1: - Part cooling fans speed in RPM</code><br />
:<code>E0@: - Hotend fan PWM value</code><br />
:<code>PRN1@: - Part cooling fan PWM value</code><br />
<br />
<br />
;Examples<sup>1</sup><br />
<br />
echo E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255<br />
<br />
;Examples<sup>2</sup><br />
<br />
echo E0:7040 RPM E0@:255<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M154: Auto Report Position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8.1}} | klipper={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Hosts normally monitor printer position by sending <code>M114</code> every couple of seconds. This adds more serial traffic and fails if the command queue is full. <code>M154</code> reduces traffic by setting the firmware to report the 'projected' position at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M154</code> the output of <code>M115</code> will report the <code>AUTOREPORT_POS</code> capability.<br />
<br />
;Usage<br />
:<code>M154 Snnn</code> : Set the auto-report interval in seconds. Set the interval to 0 to disable.<br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
:<code>Snnn</code> Interval in seconds between auto-reports. S0 to disable. (Marlin) Prusa has a Maximum: 255<sup>1</sup><br />
:<code>Cnn</code> Activate auto-report function (bit mask). Default is temperature.<sup>1</sup><br />
<br />
;C bitmap<sup>1</sup><br />
:<code>bit 0 = Auto-report temperatures</code><br />
:<code>bit 1 = Auto-report fans</code><br />
:<code>bit 2 = Auto-report position</code><br />
:<code>bit 3 = free</code><br />
:<code>bit 4 = free</code><br />
:<code>bit 5 = free</code><br />
:<code>bit 6 = free</code><br />
:<code>bit 7 = free</code><br />
<br />
;Examples<br />
M155 S1 ; Enable temperature report (Marlin: every 1 second)<br />
M155 S0 ; Stop reporting temperatures<br />
M155 S4 ; Report temperatures every 4 seconds (Marlin)<br />
M155 S4 C7; Reports temperatures, fans and position every 4 seconds (Prusa)<sup>1</sup><br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
Prusa Firmware 3.10.0+ also adds capabilities:<br />
<br />
Cap:AUTOREPORT_FANS:1<br />
Cap:AUTOREPORT_POSITION:1<br />
Cap:EXTENDED_M20:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M192: Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use <code>M192</code> to dwell until the probe is at or above a given temperature.<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Volumetric Extrusion is a firmware mode (and an option you can set in some slicers) wherein all extrusion amounts are specified as a volume —using cubic millimeters or inches (i.e., mm<sup>3</sup> or in<sup>3</sup>)— instead of a linear distance. This makes it possible to use the same G-code with any filament diameter.<br />
<br />
<code>M200</code> tells the firmware what the filament diameter is, and (if non-zero) to enable Volumetric Extrusion.<br />
<br />
Send <code>M200</code> without parameters to get the current Volumetric Extrusion state and filament diameters.<br />
<br />
Note that slicer-commanded retraction amounts must also be specified in mm<sup>3</sup> since the E axis is interpreted as a volume. However, when using Firmware Retraction (<code>G10</code> / <code>G11</code>) the retractions specified by <code>M207</code> are still set in linear units.<br />
<br />
;Parameters (Marlin)<br />
:<code>D[linear]</code> Set the filament diameter in current units. If non-zero, enable Volumetric Extrusion.<br />
:<code>T[index]</code> Select the target extruder. If omitted, the active extruder.<br />
:<code>S[bool]</code> Enable or Disable Volumetric Extrusion (without modifying the filament diameter).<br />
:<code>L[limit]</code> Set the Maximum Extrusion Volume in mm<sup>3</sup> per second. (Ignores units set by <code>G20</code>.) Use <code>L0</code> for no limit.<br />
;Examples (Marlin)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set filament diameter for the current extruder to 1.75mm<br />
M200 T1 D2.85 ; Set filament diameter for E2 to 1.75mm<br />
M200 T1 L12 ; Set Maximum Extrusion Volume for E2 to 12mm<sup>3</sup><br />
M200 S1 ; Enable Volumetric Extrusion using the last-set diameters<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Daaa:bbb:ccc...</code> Set filament diameter to aaa for extruder 1, bbb for extruder 2, etc. If any of aaa, bbb etc. are zero then Volumetric Extrusion is disabled for that extruder.<br />
:<code>Daaa</code> Set filament diameter (or disable Volumetric Extrusion) for all extruders.<br />
;Examples (RepRapFirmware)<br />
M200 D0 ; Disable Volumetric Extrusion on all extruders<br />
M200 D1.75 ; Set all extruder filament diameters to 1.75mm<br />
M200 D1.75:3.0:1.75 ; Set extruder 0 to 1.75mm, E1 to 3.0mm and the rest to 1.75mm<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn</code> Acceleration for the active or specified extruder in units/s<sup>2</sup><br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Set the acceleration that axes can do in units/s<sup>2</sup>.<br />
<br />
The <code>M201</code> command is intended to define the machine's physical limits. Slicers should use the <code>M204</code> command to define accelerations for a job and leave <code>M201</code> settings to the user.<br />
<br />
RepRapFirmware specific: Multiple colon-separated E values can be provided, so that different extruders can use different accelerations. If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201 without parameters reports the current settings.<br />
<br />
==== M201.1: Set reduced acceleration for special move types ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 and later}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis in units/s<sup>2</sup><br />
:<code>Ynnn</code> Acceleration for Y axis in units/s<sup>2</sup><br />
:<code>Znnn</code> Acceleration for Z axis in units/s<sup>2</sup><br />
:<code>Ennn:nnn...</code> Acceleration for the extruders in units/s<sup>2</sup><br />
;Example<br />
M201.1 X500 Y500 Z20 E500:500<br />
<br />
Set the acceleration that axes should use for special types of move that should be done using reduced acceleration.<br />
<br />
RepRapFirmware specific: these values are used for probing moves (because some types of Z probe can be triggered by high acceleration at the start of the move) and for moves that involve stall detection endstops (because high acceleration can bring the motor close to stalling). If a single E value is provided, that value is applied to all extruders. The values must be provided in mm/sec^2 even if G20 has been used to set units to inches. M201.1 without parameters reports the current settings.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Firmware dependent ====<br />
<br />
===== M203: Set maximum feedrate =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Firmware dependent ====<br />
<br />
===== M204: Set default acceleration =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Accelerations set with <code>M204</code> apply to the move as a whole based on the type of move. Use <code>M201</code> to set limits for each axis individually. Both of these limits will be applied during printing.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
:<code>S[accel]</code> Set Acceleration for normal moves in units/s<sup>2</sup><br />
:<code>T[accel]</code> Set Acceleration for retract/recover moves in units/s<sup>2</sup><br />
:<code>B[ms]</code> Set Minimum Segment Time to prevent planner starvation.<br />
<br />
'''Marlin notes:''' Since version 1.0.2-1 the <code>M204</code> options are:<br />
<br />
:<code>P[accel]</code> Set Acceleration for Printing moves. (i.e., Any XYZ motion plus E.)<br />
:<code>R[accel]</code> Set Acceleration for Retract moves. (i.e., E-axis only moves.)<br />
:<code>T[accel]</code> Set Acceleration for Travel moves. (i.e., without E movement)<br />
<br />
;Example<br />
<br />
Set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
M204 P800 T3000 R9000<br />
<br />
===== M204 (Repetier): Set PID values =====<br />
<br />
;Usage<br />
M204 X[Kp] Y[Ki] Z[Kd]<br />
<br />
Set one or more PID parameters. Values are 100 * real value.<br />
<br />
==== M205: Firmware dependent ====<br />
<br />
===== M205: Advanced settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205 (Repetier): EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Firmware dependent ====<br />
<br />
===== M206: Offset axes =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206 (Repetier): Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207 Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207 (Repetier): Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Firmware dependent ====<br />
<br />
===== M208: Set unretract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets the "recover" (aka "unretract") length.<br />
<br />
===== M208 (RepRapFirmware): Set axis max travel =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
With automatic retract detection, G-code generated by slicers without <code>G10</code>/<code>G11</code> support can take advantage of Firmware Retraction. The firmware converts E-only moves into retract/recover moves, using the firmware's tuned lengths and feedrates in place of the original E moves.<br />
<br />
;Example<br />
M209 S1<br />
<br />
The <code>S</code> parameter turns Automatic Retract Detection on (1) or off (0).<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/min), retract feedrate (mm/min), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{partial|Use M918}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M256: Set LCD brightness ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.3}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} | klipper={{no}} }}<br />
<br />
;Example<br />
M256 B128<br />
<br />
Set the LCD brightness B<brightness value> (value 0..255), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data (synchronously) from an i2c slave device. This command in basic form simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
:'''Snn''' (Marlin 2.0.9.3) Style of output: 0 = Raw (default), 1 = Bytes (hex), 2 = 1-2 byte (integer), 3 = Bytes (decimal)<br />
;Example<br />
M261 A99 B5 ; Request/get 5 bytes from Address 99 and print them as-is.<br />
M261 A32 B7 S1 ; Request/get 7 bytes from Address 32 and print them as space-delimited hex bytes.<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M281: Set Servo Angles ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set the angles for a servo's deployed (or selected) and stowed (or unselected) states. To activate this command in Marlin enable the <code>EDITABLE_SERVO_ANGLES</code> option.<br />
<br />
;Parameters<br />
:<code>P[index]</code> - Servo Index<br />
:<code>L[angle]</code> - Deployed / Selected Angle<br />
:<code>U[angle]</code> - Stowed / Unselected Angle<br />
<br />
;Example<br />
M281 P0 L30 U90<br />
<br />
==== M282: Detach Servo ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.9.2}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Detach servo. This disables the servo until its next move. To activate this command in Marlin enable the <code>SERVO_DETACH_GCODE</code> option.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
;Example<br />
M282 P1<br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M309: Set or report heater feedforward ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' Tool number<br />
:'''Saaa:bbb:ccc...''' Feedforward coefficients. The number of coefficients provided must equal the number of heaters configured for the tool when it was created (see M563).<br />
<br />
If the P parameter is not provided, the current tool is assumed. If the S parameter is not provided, the existing coefficients are reported.<br />
<br />
The units of '''S''' are PWM fraction (on a scale of 0 to 1) per mm/sec of filament forward movement.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
M355 P0 ; Turn light off<br />
M355 P128 ; Turn light on with half power<br />
M355 P255 ; Turn light on with full power<br />
<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Lower z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Lower z-probe if present. In RepRapFirmware this runs macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Raise z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter is given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter if given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.x+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M510: Lock Machine ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Lock the machine. When the machine is locked a passcode is required to unlock it. Use <code>M511 P</code> with your passcode to unlock the machine. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
==== M511: Unlock Machine with Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode and unlock the machine if it is correct. Otherwise, delay for a period of time before allowing another attempt. In Marlin this feature is enabled with the <code>PASSWORD_FEATURE</code> option.<br />
<br />
;Parameters<br />
:'''P"passcode"''' ; a numeric passcode to try<br />
<br />
==== M512: Set Passcode ====<br />
{{Firmware Support | marlin={{yes}}: 2.0.6.1 }}<br />
<br />
Check the given passcode (<code>P</code>) and if it is correct clear the passcode. If <code>S</code> is given, set a new passcode. In Marlin this feature is enabled with the <code>PASSWORD_CHANGE_GCODE</code> option.<br />
<br />
;Parameters<br />
:'''P"oldpass"''' ; the current numeric passcode<br />
:'''S"newpass"''' ; a new numeric passcode<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{yes|2.0.0+}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: Use M512 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway and/or DNS server ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 2.0.8 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Innn</code> (Optional) Number of the network interface to manage (defaults to 0)<br />
:<code>Pnnn</code> Gateway<br />
:<code>Snnn</code> (Optional) DNS server (only supported by DSF 3.3 with DuetPi system config plugin)<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
:<code>Pnnn</code> Apply XY compensation to Y axis instead of X (defaults to 0, requires RRF 3.2-b4 or newer)<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Tool settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.3 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn''' Tool number. If this parameter is not provided, the current tool is assumed.<br />
:'''Rnnn''' Standby temperature(s)<br />
:'''Snnn''' Active temperature(s)<br />
:'''Fnnn''' Spindle RPM, always positive<br />
:'''An''' Required heater state: 0 = off, 1 = standby temperature(s), 2 = active temperature(s)<br />
<br />
;Examples:<br />
:M568 P1 R140 S205 ; set standby and active temperatures for tool 1<br />
:M568 P0 F5200 ; set spindle RPM for tool 0<br />
:M568 P2 A1 ; set tool 2 heaters to their standby temperatures<br />
<br />
RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The R value is the standby temperature in °C that will be used for the tool, and the S value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same.<br />
<br />
Temperatures set with M568 do not wait for the heaters to reach temp before proceeding. In order to wait for the temp use a M116 command after the M568 to wait for temps to be reached.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop, 4=closed loop<br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3 (Duet 3 EXP1HCL board also supports mode 4)<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
:<code>Hn</code> Minimum holding current as a percentage of the configured current when operating in closed loop mode<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers. Switching between open loop and closed loop modes is done using M569.<br />
<br />
==== M569.2: Read or write any stepper driver register ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Rnn</code> Register number, 0-127<br />
:<code>Vnnnn</code> Value to write (optional)<br />
;Example<br />
:<code>M569.2 P1 R0</code><br />
<br />
If the V parameter is not provided, this command reads the specified register and returns the value of that register. If the V parameter is provided, that value is written to the specified register.<br />
<br />
WARNING! Use of M569.2 to write stepper driver registers may result in damage to the stepper drivers, for example from excessive motor current or insufficient blanking time.<br />
<br />
==== M569.3: Read Motor Driver Encoder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | grbl={{no}} }}<br />
<br />
This causes the RepRap machine to report its current motor encoder positions to the host in units of arc degrees (1/360'ths of turns), relative to some reference position that you set with the <code>S</code> parameter.<br />
<br />
Before the first call with the <code>S</code> parameter, the reference is unknown and arbitrary.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Several (remote) drivers may be specified, separated by colon. No more than number of visible axes, as specified by <code>M584 P</code> parameter, are allowed.<br />
:<code>S</code> Sets an encoder reference point. Current and subsequent <code>M569.3 Pn.n</code> calls returns numbers that are relative to the <code>M569.3 Pn.n S</code> call.<br />
<br />
If <code>P</code> is not supplied, an error is returned.<br />
<br />
A maximum of four CAN-connected drivers can be reached with <code>M569.3</code> counting from machine boot. CAN addresses that fail to respond don't count towards this maximum.<br />
<br />
;Examples<br />
M569.3<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.3 P54.0<br />
<tt>Error: M569.3: Message not received</tt><br />
M569.3 P40.0:41.0:42.0:43.0<br />
<tt>[-155.28, -4089.60, 6842.04, 0.00, ],</tt><br />
M569.3 P43.0:41.0:42.0:40.0<br />
<tt>[0.00, -4089.60, 6842.04, -155.28, ],</tt><br />
M569.3 P40.0:41.0:42.0:43.0 S<br />
<tt>[0.00, 0.00, 0.00, 0.00, ],</tt><br />
M569.3 P49.0<br />
<tt>Error: M569.3: Max CAN addresses we can reference is 4. Can't reference board 49.</tt><br />
<br />
;Notes<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.4: Set Motor Driver Torque Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Tell one or more motor drivers to apply a specified torque regardless of position.<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number. Can also be a colon separated list of driver numbers.<br />
:<code>Tn</code> Where n is the mode/torque to apply in units of Nm.<br />
<br />
If <code>P</code> or <code>T</code> parameter is missing, then no action is taken.<br />
The driver is put back into position mode by requesting a torque smaller than 0.0001 Nm.<br />
<br />
;Examples<br />
M569.4<br />
<tt>Error: M569: missing parameter 'P'</tt><br />
M569.4 P40.0:41.0<br />
<tt>Error: M569: missing parameter 'T'</tt><br />
M569.4 P40.0 T0.001<br />
<tt>0.001000 Nm,</tt><br />
M569.4 P40.0:41.0 T0<br />
<tt>pos_mode, pos_mode,</tt><br />
<br />
;Notes<br />
Hangprinter's "torque mode" is implemented as a ReprapFirmware macro that depends on M569.4.<br />
<br />
Practical torques for tightening lines in daily use tend to lie between 0.1 Nm and 0.001 Nm for a Hangprinter.<br />
<br />
<sup>1</sup> Planned for RepRapFirmware 3.4.<br />
<br />
==== M569.5: Collect Data from Closed-loop Driver ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.6: Execute Closed-loop Driver Tuning Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address and driver number<br />
<br />
Remaining details TBD.<br />
<br />
==== M569.7: Configure motor brake port ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.4 onwards}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn.n</code> Motor CAN board address (if applicable) and driver number<br />
:<code>C"port"</code> Port name of the brake control port. The port must be on the same CAN board as the driver. The CAN address does not need to be specified in the port name, but if it is then it must be the same as the driver address.<br />
;Example<br />
:<code>M569.7 P40.0 C"out2" ; driver 0 on board 40 uses port out1 on board 40 to control the brake<br />
<br />
When the motor driver is enabled, the specified output port will be turned on at the same time to release the brake. When the motor driver is disabled, the output port will be turned off. Idle current mode does not count as disabled.<br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter). Supported by RepRapFirmware-dc42, -ch and -dn.<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.2 usually gives the best print quality.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate<br />
:<code>Snnn</code> Whether checksums should be used<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue) and P2 specifies a second auxiliary port if there is one. The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port). The <code>S</code> parameter is a bitmap of features. The lowest bit, if set, specifies that only commands that include a valid checksum should be accepted from this comms channel.<br />
<br />
==== M576: Set SPI comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Maximum delay between full SPI transfers (in ms, defaults to 25ms)<br />
:<code>Fnnn</code> Maximum delay between full SPI transfers when a file is open (in ms, defaults to 5ms)<br />
:<code>Pnnn</code> Number of events required to skip the delay (defaults to 4)<br />
;Example<br />
M576 S10 ; set data exchange interval to 10ms<br />
<br />
This sets the communications parameters of the SPI channel. Supported in RRF 3.4 and later in SBC mode.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
:<code>C"site"</code> Set or reset allowed site for cross-orgin HTTP requests (RRF > 3.2-b4.1)<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
:<code>Lnn.nn.nn.nn</code> (optional, supported only by DuetPi + DSF v3.3 or newer) DNS server to use<br />
:<code>Cnnn</code> (supported only by DuetPi + DSF v3.3 or newer) Country code for the WiFi adapter, only required if not set before<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}}}}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M595: Set movement queue length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.2+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | klipper={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Maximum number of moves held in the movement queue. RepRapFirmware uses this value to determine how many DDA objects to allocate.<br />
:'''Snn''' (optional) Number of pre-allocated per-motor movement objects. If the number of pre-allocated objects is insufficient, RepRapFirmware will attempt to allocate additional omnes dynamically when they are needed.<br />
<br />
Different features of motion control firmware may have competing demands on microcontroller RAM. In particular, operations that use many short segments (e.g. laser rastering) need longer movement queues than typical 3D printing, but have fewer motors to control. This command allows the movement queue parameters to be adjusted so that the queue can be lengthened if necessary, or kept short if a long movement queue is not needed and there are other demands on RAM.<br />
<br />
M595 without any parameters reports the length of the movement queue and the number of per-motor movement objects allocated.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print (Prusa i3) ====<br />
{{Firmware Support | marlin={{no|M524}} | prusa={{yes}} }}<br />
<br />
Stop print on Prusa i3 MK2/s, MK2.5/s, and MK3/s.<br />
<br />
==== M603: Configure Filament Change ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes|dev}} }}<br />
<br />
This command configures Filament Change behavior in Marlin Firmware and in Prusa mini firmware under development.<br />
<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M563}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the <code>M563</code> tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: Execute peel move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | klipper={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M808: Set or Goto Repeat Marker ====<br />
{{Firmware Support | fived={{no}} | yaskawa={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.8}} | repetier={{no}} | reprapfirmware={{partial|Planned for 3.3}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{no}} | redeem={{no}} | prusa={{no}} | klipper={{no}} | mk4duo={{no}} | makerbot={{no}} }}<br />
<br />
The <code>M808 L[count]</code> command is used in a G-code file to set a Repeat Marker beginning at the start of the following line. For an SD print, the firmware will save a marker with the file's byte position and the count given by the <code>L</code> parameter. To set an infinite loop use <code>L0</code>. To terminate an infinite loop from the host, <code>M808 K</code> will cancel all current loops.<br />
<br />
The <code>M808</code> command (no parameters) will cause G-code processing to loop back to the previous Repeat Marker as many times as specified. Ideally, each instance of <code>M808 L</code> should have a corresponding <code>M808</code>.<br />
<br />
The number of nested <code>M808 L</code> commands is limited to the depth set in the firmware. To enable this feature in Marlin, define <code>GCODE_REPEAT_MARKERS</code>. Hosts should look for <code>Cap:REPEAT</code>. At this time the feature only applies to printing direct from media and otherwise <code>M808</code> is ignored, so host developers are free to come up with their own approach to these codes with no nesting limit and make it work with any old firmware.<br />
<br />
;Example<br />
M808 L10 ; Set Marker to repeat 10 times<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End Marker<br />
<br />
RepRapFirmware processes M808 as follows:<br />
: - '''M808 S{''ccc''}''' translates into '''while ''ccc''''' followed by block begin. ''ccc'' must yield ''true'' or ''false''. For more on while-loops and expressions in RepRapFirmware, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands.<br />
: - '''M808 L''nn''''' is equivalent to '''M808 S{''nn'' == 0 || iterations < ''nn''}'''.<br />
: - '''M808''' without S or L parameter ends the block.<br />
: - As usual, predefined constant ''iterations'' reports the number of completed iterations of the innermost loop.<br />
: - '''M808''' without S or L parameter when not inside a loop, or any M808 command in an input stream other than a SD print file, gives rise to an error message.<br />
<br />
===== M808 in Marlin 2.0.8 =====<br />
<br />
M808 L ; Set marker to repeat infinitely<br />
M300 P100 S440 ; Beep!<br />
M300 P10 S0 ; Silence<br />
M808 ; End marker<br />
M808 K ; Sent from host to cancel the loop<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with <code>G28</code>. This value may also be used by <code>G29</code> to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch (this is a common setup on Delta machines).<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by <code>M502</code>) is set by the <code>Z_PROBE_OFFSET_FROM_EXTRUDER</code> setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4&nbsp;mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
==== M860 Wait for Probe Temperature ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
==== M861 Set Probe Thermal Compensation ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M871: PTC Configuration ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<code>M871</code> allows you to modify the Z adjustments corresponding to temperatures.<br />
<br />
;Parameters<br />
:<code>B</code> Set the Z adjustment for bed temperature<br />
:<code>P</code> Set the Z adjustment for probe temperature<br />
:<code>E</code> Set the Z adjustment for extruder temperature<br />
<br />
;Examples<br />
M871 B V0.1 I3 ; Set Z adjustment for bed temp index 3 to 0.1<br />
M871 E V-1 I2 ; Set Z adjustment for extruder temp index 3 to -1<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller, 2 = 128x64 mono display using ST7567 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
:'''F''' (optional, supported in RRF 2.03 and later) SPI clock frequency in Hz, default 2000000 (i.e. 2MHz)<br />
:'''C''' (optional, supported in RRF 3.2 and later) Display contrast, in range 0 to 100. Only used with ST7567-based displays. ST7920-based displays usually have a contrast potentiometer instead.<br />
:'''R''' (optional, supported in RRF 3.2 and later) Display resistor ratio, in range 1 to 7. Only used with ST7567-based displays. The default value of 6 is suitable for the Fysetc Mini 12864 display. Some other displays need 3.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches seen by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M954: Configure as CAN expansion board ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.3+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Ann''' CAN address to use (required)<br />
<br />
This command is used to reconfigure the board it is executed on as a CAN-connected expansion board. It would typically be the only command in the config.g file. When it is executed, the board changes its CAN address to the one specified in the A parameter, stops sending CAN time sync messages, and responds to requests received via CAN just like a regular expansion board. A few GCode commands can still be executed locally for diagnostic purposes, for example M111 and M122.<br />
<br />
==== M955: Configure Accelerometer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters (provisional)<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Inn''' Accelerometer orientation<br />
:'''Snnn''' Sample rate (Hz)<br />
:'''Rnn''' Resolution (bits), typically 8, 10 or 12<br />
<br />
This command configures an accelerometer.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
If none of the other parameters are provided, the current configuration of the specified accelerometer is reported. Otherwise the configuration of that accelerometer is adjusted according to the I, S, and R parameters. These configuration settings persist until they are changed.<br />
<br />
The I (orientation) parameter tells the firmware which of the 24 possible orientations the accelerometer chip is in relative to the printer axes. It is expressed as a 2-digit number. The first digit specifies which machine direction the Z axis of the accelerometer chip (usually the top face of the chip) faces, as follows: 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. The second digit expresses which direction the X axis of the accelerometer chip faces, using the same code. If the accelerometer chip axes line up with the machine axis, the orientation is 21. This is the default orientation if no orientation has been specified.<br />
<br />
The S and R parameters control how the accelerometer is programmed. The R parameter is ignored unless the S parameter is also provided. If S is provided but R is missing, a default resolution is used. The sensor resolution will be adjusted to be no greater than the value of the R parameter (or the minimum supported resolution if greater), then the sensor sampling rate will be adjusted to a value supported at that resolution that is close to the S parameter. The actual rate and resolution selected can be found by using M955 with just the P parameter.<br />
<br />
==== M956: Collect accelerometer data and write to file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' or '''Pbb.nn''' Accelerometer to use (required)<br />
:'''Snnn''' Number of samples to collect (required)<br />
:'''X''' and/or '''Y''' and/or '''Z''' Machine axes to collect data for. If no axes are specified, data is collected for all three axes.<br />
:'''An''' (required) 0 = activate immediately, 1 = activate just before the start of the next move, 2 = activate just before the start of the deceleration segment of the next move<br />
:'''Kn''' (optional, default 0) Skip the specified number of moves before activating (use with A1 or A2)<br />
<br />
This command causes the specified number of accelerometer samples to be collected and saved to a .csv file on the SD card.<br />
<br />
The P parameter selects which accelerometer to use and is mandatory. To use an accelerometer on a CAN-connected expansion board, use the form '''P'''''board-address''.''device-number'' for example '''P22.0'''.<br />
<br />
==== M957: Raise event ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.4+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''S"type"''' Event type name<br />
:'''Pnn''' or '''Pbb.nn''' Device number to which the event relates, optionally including the CAN address of the board concerned<br />
:'''Rnn''' Optional additional data about the event (unsigned integer)<br />
<br />
This command is used to raise an event internally as if the event had actually occurred, and execute any related handler macro for that event. Its main use is to test event handler macros.<br />
<br />
The event type names are firmware-dependent. In RepRapFirmware they are: mainBoardPowerFail, heaterFault, driverError, filamentError, driverWarning, mcuTemperatureWarning.<br />
<br />
The meaning of the device number depends on the event type. For a driver error it is the driver number. For a heater fault it is the heater number. For a filament error it is the extruder number.<br />
<br />
The meaning of the optional additional parameter also depends on the event type. For example, for a driver error it is the driver status.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - WiFi module firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - Reserved (on Duet WiFi running RepRapFirmware 1.18 and earlier, was web server file system) <br />
<br />
3 - Duet WiFi main boards: put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port. Duet 3 expansion boards: update the bootloader (RepRapFirmware 3.2 and later).<br />
<br />
4 - Updates the firmware on an attached PanelDue v3 or later touch screen (supported in RRF 3.2 and later)<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
:<code>Bnnn</code> CAN address of the board to reset (RRF only)<sup>2</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<sup>2</sup>Starting from RRF 3.3 this parameter may be set to -1 to reboot the attached SBC (DuetPi + SBC)<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If absent then all the above macros will be run. Otherwise pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
NOTE: These D codes are not compatible with the Gcode spec ( NIST Gcode spec, initially written for CNC, which Reprap initially messed up, after what the CNC side of Reprap has spent years trying to get Reprap back to respecting it ), and will make life hell for those building machines that do more than just 3D printing, or controllers that support this, as well as possibly cause other issues. I see this is from Prusa, and I know these guys are really cool about Open-Source, so I'm sure they care a lot about respecting standards and other projects as well, so I'm certain they'll fix this as soon as they see there is an issue. Thankfully this is very easy to fix, just change from D1 to Mxxx D1, where you find a Mxxx Gcode that is currently free and start using it. In Gcode, only M, G and T are keywords, D is a parameter, you can't make it a keyword without messing everything up. I'm sure for your subset of using Gcode, that's probably just fine, but it's not for the rest of us, and the whole point of adding things to this page, is for others to use it if they want/can/need, and the way it currently is ( breaking a standard ), this can't be used by others. Links:<br />
* https://en.wikipedia.org/wiki/G-code<br />
* https://www.nist.gov/publications/nist-rs274ngc-interpreter-version-3<br />
This note by: -- wolf.arthur@gmail.com<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
'''Background:''' Every 3D printer has parameters that need to be persistent but also easily tunable, such as extrusion steps-per-mm and various planner values. Some of these parameters are hardcoded in firmware so that a user has to modify, recompile, and re-flash the firmware for certain adjustments, while others can be modified with an M-code and stored to the EEPROM or other persistent storage.<br />
<br />
'''Current implementations:'''<br />
<br />
:[[Marlin]] and [[Sprinter]] use G-codes <code>M500</code>-<code>M503</code> to save, load, reset, and report the settings mirrored in EEPROM. Note that the <code>M503</code> command reports settings that may not have been saved to EEPROM yet.<br />
<br />
:[[Teacup]] uses G-codes <code>M130</code>-<code>M136</code> to set, read, and save PID values.<br />
<br />
:[[Repetier Firmware]] uses <code>M206</code> to set a stored value (using an ID number) and <code>M205</code> to report settings.<br />
<br />
:[[RepRapFirmware]] uses the <code>config-override.g</code> file on the SD card for settings storage. <code>M500</code> saves some values to that file, <code>M501</code> re-loads settings from this file, and <code>M502</code> loads the "factory settings" values from <code>config.g</code>, ignoring <code>config-override.g</code>.<br />
<br />
''Please see the RFC [[M-codes for EEPROM config]] proposed by [[User:AlexRa|AlexRa]] in March of 2011. There is currently no working implementation of the proposed commands.''<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
The current versions of Pronterface and OctoPrint can interpret special commands sent by the firmware of the form:<br />
<br />
//action:<command><br />
<br />
Other hosts simply ignore or echo this output from the firmware.<br />
<br />
The available Host Action Commands are:<br />
<br />
* <code>start</code>: Tell the host to start the currently selected print job. (OctoPrint 1.5.0+)<br />
* <code>pause</code>: Tell the host to pause the print job.<br />
* <code>resume</code>: Tell the host to resume the print job.<br />
* <code>disconnect</code>: Tell the host to disconnect from the printer.<br />
* <code>cancel</code>: Tell the host to abort the current job.<br />
* <code>out_of_filament T<extruder_id></code>: Tell the host that an extruder's filament is out or jammed. Host should issue a pause and can offer better help to the user. For backwards-compatibility it should be followed by the <code>pause</code> action.<br />
* <code>paused</code>: Tell the host that a printer-controlled print job was paused. (OctoPrint 1.3.9+)<br />
* <code>resumed</code>: Tell the host that a printer-controlled print job was resumed. (OctoPrint 1.3.9+)<br />
* <code>probe_rewipe</code>: Display a "<code>G29</code> Probing Retrying" alert. (Lulzbot Cura 3.6+)<br />
* <code>probe_failed</code>: Cancel the print job and display a "<code>G29</code> Probing Failed" alert. (Lulzbot Cura 3.6+)<br />
* <code>sd_inserted</code>: The SD card was inserted. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_ejected</code>: The SD card was ejected. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
* <code>sd_updated</code>: The SD card was updated. Hosts should update internal state as needed. (OctoPrint 1.6.0+)<br />
<br />
Action commands can also be sent by the firmware to have the host show alerts and prompts for user feedback. The following commands are supported by OctoPrint 1.3.9 or later with the "Action Command Prompt support" plugin enabled.<br />
<br />
* <code>prompt_begin <message></code>: Start a user prompt dialog that displays <code><message></code> to the user.<br />
* <code>prompt_choice <text></code>: Define a dialog choice with the associated <code><text></code>.<br />
* <code>prompt_button <text></code>: Same as <code>prompt_choice</code>.<br />
* <code>prompt_show</code>: Tell the host to prompt the user with the defined dialog.<br />
* <code>prompt_end</code>: Tell the host to close the dialog (e.g., the choice was made from the printer's own UI).<br />
<br />
After showing a user dialog the host should wait for feedback and send the user's selection back to the firmware with <code>M876 Snnn</code> as described in [[G-Code#M876:_Dialog_handling]]. On connection (or whenever the functionality is enabled in the host) the host can tell the firmware that it supports host dialogs by sending <code>M876 P1</code>.<br />
<br />
For more detailed examples of <code>prompt_*</code> action command dialogs, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M105 S3</code> (now deprecated in favor of <code>M408</code>)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands-per-second that can be sent to the control board, and the USB stack on the host and the serial interface driver on the Arduino also add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14https://reprap.org/mediawiki/index.php?title=G-code&diff=188152G-code2020-08-19T16:21:06Z<p>Espr14: </p>
<hr />
<div>{{Languages|G-code}}<br />
----<br />
<br />
This page tries to describe the flavour of '''G-codes''' that the RepRap firmwares use and how they work. The main target is additive fabrication using [[FFF]] processes. Codes for print head movements follow the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard], so RepRap firmwares are quite usable for CNC milling and similar applications as well. See also on [https://en.wikipedia.org/wiki/G-code Wikipedia's G-code article].<br />
<br />
There are a few different ways to prepare G-code for a printer. One method would be to use a slicing program such as [[Slic3r]], [[Skeinforge]] or [[Cura]]. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. Another option for G-code generation is to use a lower level library like [[mecode]]. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. The final option is to just write the G-code yourself. This may be the best choice if you just need to run a few test lines while calibrating your printer.<br />
<br />
As many different firmwares exist and their developers tend to implement new features without discussing strategies or looking what others did before them, a lot of different sub-flavours for the 3D-Printer specific codes developed over the years. This particular page is the master page for RepRap. Nowhere in here should the same code be used for two different things; there are always more numbers to use... The rule is: '''add your new code here, then implement it'''.<br />
<br />
Unfortunately human nature being what it is, the best procedures aren't always followed, so some multiple uses of the same code exist. The rule which should be followed is that later appearances of a code on this page (later than the original use of a code), are deprecated and should be changed, unless there is a good technical reason (like the general G-Code standard) why a later instance should be preferred. Note that the key date is appearance here, not date of implementation.<br />
<br />
== Introduction ==<br />
<br />
A typical piece of G-code as sent to a RepRap machine might look like this:<br />
<br />
N3 T0*57<br />
N4 G92 E0*67<br />
N5 G28*22<br />
N6 G1 F1500.0*82<br />
N7 G1 X2.0 Y2.0 F3000.0*85<br />
N8 G1 X3.0 Y3.0*33<br />
<br />
G-code can also be stored in files on SD cards. A file containing RepRap G-code usually has the extension <code>.g</code>, <code>.gco</code> or <code>.gcode</code>.<br />
Files for BFB/RapMan have the extension <code>.bfb</code>.<br />
G-code stored in file or produced by a slicer might look like this:<br />
<br />
G92 E0<br />
G28<br />
G1 F1500<br />
G1 X2.0 Y2.0 F3000<br />
G1 X3.0 Y3.0<br />
<br />
The meaning of all those symbols and numbers (and more) is explained below.<br />
<br />
Slicers will (optionally?) add G-code scripts to the beginning and end of their output file to perform specified actions before and/or after a print such as z-probing the build-area, heating/cooling the bed and hotend, performing ooze free "nozzle wipe" startup routine, switching system power on/off, and even "ejecting" parts. More info on the [[Start GCode routines]] and [[End GCode routines]] pages.<br />
<br />
To find out which specific G-code(s) are implemented in any given firmware, there are little tables attached to the command descriptions, like this one:<br />
{{Firmware Support | fived={{yes}} | teacup={{automatic}} | sprinter={{no}} | marlin={{partial}} | repetier={{experimental}} | smoothie={{???}} | redeem={{yes}} | mk4duo={{partial}} | yaskawa={{yes}} }}<br />
<br />
Here means:<br />
;{{m|yes}}<br />
:The G-code is fully supported by the firmware.<br />
;{{m|partial}} or {{m|experimental}}<br />
:There is some support for the G-code. Often it is required to check out the source code branch for the firmware (usually stored in a different branch) or to flip configuration switches on the mainboard.<br />
;{{m|automatic}}<br />
:The firmware handles this G-code automatically, so there's no need to send the command. An example is power supply on/off G-code (M80/M81) in the Teacup firmware.<br />
;{{m|???}}<br />
:It is unknown if the firmware supports this G-code. You may want to test this yourself before using it in production.<br />
;{{m|no}}<br />
:The firmware does not support this G-code.<br />
<br />
For the technically-minded, G-code line endings are Unix Line Endings (<code>\n</code>), but will accept Windows Line Endings (<code>\r\n</code>), so you should not need to worry about converting between the two, but it is best practice to use Unix Line Endings where possible.<br />
<br />
== Fields ==<br />
<br />
A RepRap G-code is a list of fields that are separated by white spaces or line breaks. A field can be interpreted as a command, parameter, or for any other special purpose. It consists of one letter directly followed by a number, or can be only a stand-alone letter (Flag). The letter gives information about the meaning of the field (see the list below in this section). Numbers can be ''integers'' (128) or ''fractional'' numbers (12.42), depending on context. For example, an X coordinate can take integers (<code>X175</code>) or fractionals (<code>X17.62</code>), but selecting extruder number 2.76 would make no sense. In this description, the numbers in the fields are represented by <code>nnn</code> as a placeholder.<br />
<br />
In RepRapFirmware, some parameters can be followed by more than one number, with colon used to separate them. Typically this is used to specify extruder parameters, with one value provided per extruder. If only one value is provided where a value is needed for each extruder, then that value is applied to all extruders.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Letter<br />
! Meaning<br />
|-<br />
| Gnnn<br />
| Standard G-code command, such as move to a point<br />
|-<br />
| Mnnn<br />
| RepRap-defined command, such as turn on a cooling fan<br />
|-<br />
| Tnnn<br />
| Select tool nnn. In RepRap, a tool is typically associated with a nozzle, which may be fed by one or more extruders.<br />
|-<br />
| Snnn<br />
| Command parameter, such as time in seconds; temperatures; voltage to send to a motor<br />
|-<br />
| Pnnn<br />
| Command parameter, such as time in milliseconds; proportional (Kp) in PID Tuning<br />
|-<br />
| Xnnn<br />
| A X coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Ynnn<br />
| A Y coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| Znnn<br />
| A Z coordinate, usually to move to. This can be an Integer or Fractional number.<br />
|-<br />
| U,V,W<br />
| Additional axis coordinates (RepRapFirmware)<br />
|-<br />
| Innn<br />
| Parameter - X-offset in arc move; integral (Ki) in PID Tuning<br />
|-<br />
| Jnnn<br />
| Parameter - Y-offset in arc move<br />
|-<br />
| Dnnn<br />
| Parameter - used for diameter; derivative (Kd) in PID Tuning<br />
|-<br />
| Hnnn<br />
| Parameter - used for heater number in PID Tuning<br />
|-<br />
| Fnnn<br />
| Feedrate in mm per minute. (Speed of print head movement)<br />
|-<br />
| Rnnn<br />
| Parameter - used for temperatures<br />
|-<br />
| Qnnn<br />
| Parameter - not currently used<br />
|-<br />
| Ennn<br />
| Length of extrudate. This is exactly like X, Y and Z, but for the length of filament to consume.<br />
|-<br />
| Nnnn<br />
| Line number. Used to request repeat transmission in the case of communications errors.<br />
|-<br />
| *nnn<br />
| Checksum. Used to check for communications errors.<br />
|-<br />
|}<br />
<br />
== Case sensitivity ==<br />
<br />
The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.<br />
<br />
;Firmwares that are known to be case-insensitive:<br />
:RepRapFirmware version 1.19 and later (except within quoted strings)<br />
<br />
;Firmwares that are known to be case-sensitive:<br />
:RepRapFirmware version 1.18 and earlier<br />
<br />
== Quoted strings ==<br />
<br />
In RepRapFirmware, some commands support quoted strings when providing file names and other string parameters. This allows file names, WiFi passwords etc. to contain spaces, semicolons and other characters that would otherwise not be permitted. Double-quote characters are used to delimit the string, and any double-quote character within the string must be repeated.<br />
<br />
Unfortunately, many gcode sender programs convert all characters to uppercase and don't provide any means to disable this feature. Therefore, within a quoted-string, the single-quote character is used as a flag to force the following character to lowercase. If you want to include a single quote character in the string, use two single quote characters to represent one single quote character.<br />
<br />
Example: to add SSID MYROUTER with password <code>ABCxyz;" 123</code> to the WiFi network list, use command:<br />
<br />
<code>M587 S"MYROUTER" P"ABCxyz;"" 123"</code><br />
<br />
or if you can't send lowercase characters:<br />
<br />
<code>M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"</code><br />
<br />
== Using expressions in parameters ==<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.1 and later allow parameter values to be computed from an expression enclosed in { }. Such an expression may include constants, values from the machine object model, operators and functions. Example:<br />
<br />
<code>G1 X{move.axes[0].max-5} Y{move.axes[1].max+5} F6000 ; move to 5mm short of the X and Y axis limits</code><br />
<br />
See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands for more details.<br />
<br />
== Comments ==<br />
<br />
G-code comments begin at a semicolon, and end at the end of the line:<br />
<br />
<pre><br />
N3 T0*57 ; This is a comment<br />
N4 G92 E0*67<br />
; So is this<br />
N5 G28*22<br />
</pre><br />
<br />
Some firmwares also obey the CNC G-code standard, which is to enclose comments in round brackets. Comments of this form must start and end on the same line:<br />
<br />
<pre><br />
(Home some axes)<br />
G28 (here come the axes to be homed) X Y<br />
</pre><br />
<br />
Comments and white space will be ignored by your RepRap Printer. It's better to strip these out on the host computer before sending the G-code to your printer, as this saves bandwidth.<br />
<br />
== Special fields ==<br />
<br />
==== N: Line number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | machinekit={{yes}} | grbl={{???}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
N123<br />
<br />
If present, the line number should be the first field in a line. For G-code stored in files on SD cards the line number is usually omitted.<br />
<br />
If checking is supported, the RepRap firmware expects line numbers to increase by 1 each line, and if that doesn't happen it is flagged as an error. But you can reset the count using <code>M110</code> (see below).<br />
<br />
Although supported, usage of N in Machinekit is discouraged as it serves no purpose.<br />
<br />
==== *: Checksum ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Example: <code>*71</code><br />
<br />
If present, the checksum should be the last field in a line, but before a comment. For G-code stored in files on SD cards the checksum is usually omitted.<br />
<br />
The firmware compares the checksum against a locally-computed value. If they differ, it requests a repeat transmission of the line.<br />
<br />
== Checking ==<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
N123 [...G Code in here...] *71<br />
<br />
The RepRap firmware checks the line number and the checksum.<br />
You can leave both of these out - RepRap will still work, but it won't do checking. You have to have both or neither though.<br />
If only one appears, it produces an error.<br />
<br />
The checksum "cs" for a G-code string "cmd" (including its line number) is computed by exor-ing the bytes in the string up to and not including the * character as follows:<br />
<br />
int cs = 0;<br />
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)<br />
cs = cs ^ cmd[i];<br />
cs &= 0xff; // Defensive programming...<br />
<br />
and the value is appended as a decimal integer to the command after the * character.<br />
<br />
== Conditional Execution and Loops ==<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | grbl={{???}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
RepRapFirmware 3.01 and later supports conditions and loops in GCode, and expression evaluation in the parameters to GCode commands. Properties from the firmware object model (e.g. current position, current tool) can be included in expressions. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands for details.<br />
<br />
== Buffering ==<br />
{{Firmware Support | fived={{yes}} | marlin={{yes}} | teacup={{yes}} | reprapfirmware={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
If buffering is supported, the RepRap firmware stores some commands in a ring buffer internally for execution. This means that there is no (appreciable) delay while a command is acknowledged and the next transmitted. In turn, this means that sequences of line segments can be plotted without a dwell between one and the next. As soon as one of these buffered commands is received it is acknowledged and stored locally. If the local buffer is full, then the acknowledgment is delayed until space for storage in the buffer is available. This is how flow control is achieved.<br />
<br />
Typically, the following moving commands are buffered: <code>G0</code>-<code>G3</code> and <code>G28</code>-<code>G32</code>. The [[Teacup Firmware]] buffers also some setting commands: <code>G20</code>, <code>G21</code>, <code>G90</code> and <code>G91</code>. All other <code>G</code>, <code>M</code> or <code>T</code> commands are not buffered.<br />
<br />
[[RepRapFirmware]] also implements an internal queue to ensure that certain codes (like [[G-code#M106:_Fan_On|M106]]) are executed in the right order and not when the last move has been added to the look-ahead queue.<br />
<br />
When an unbuffered command is received it is stored, but it is not acknowledged to the host until the buffer is exhausted and then the command has been executed. Thus the host will pause at one of these commands until it has been done. Short pauses between these commands and any that might follow them do not affect the performance of the machine.<br />
<br />
== G-commands ==<br />
<br />
==== G0 & G1: Move ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
* <code>G0</code> : Rapid Move<br />
* <code>G1</code> : Linear Move<br />
<br />
;Usage<br />
:<code>G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
:<code>G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' has to be used''<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Znnn</code> The position to move to on the Z axis<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
:<code>Hnnn</code> (RepRapFirmware) Flag to check if an endstop was hit ''(<code>H1</code> to check, <code>H0</code> to ignore, <code>H2</code> see note, default is <code>H0</code>)''<sup>1</sup><br />
:<code>Rnnn</code> (RepRapFirmware) Restore point number <sup>4</sup><br />
:<code>Snnn</code> Laser cutter/engraver power. In RepRapFirmware, when not in laser mode S in interpreted the same as H.<br />
;Examples<br />
G0 X12 ; move to 12mm on the X axis<br />
G0 F1500 ; Set the feedrate to 1500mm/minute<br />
G1 X90.6 Y13.8 E22.4 ; Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material<br />
<br />
The RepRap firmware spec treats <code>G0</code> and <code>G1</code> as the same command, since it's just as efficient as not doing so.<sup>2</sup><br />
<br />
Most RepRap firmwares do subtle things with feedrates.<br />
<br />
G1 F1500 ; Set feedrate to 1500mm/m<br />
G1 X50 Y25.3 E22.4 ; Move and extrude<br />
<br />
In the above example, we first set the feedrate to 1500mm/m, then move to 50mm on X and 25.3mm on Y while extruding 22.4mm of filament between the two points.<br />
<br />
G1 F1500 ; Feedrate 1500mm/m<br />
G1 X50 Y25.3 E22.4 F3000 ; Accelerate to 3000mm/m<br />
<br />
However, in the above example, we set a feedrate of 1500 mm/m, then do the same move, but accelerating to 3000 mm/m. Everything stays synchronized, so extrusion accelerates right along with X and Y movement.<br />
<br />
The RepRap spec treats the feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over the acceleration and deceleration of the printer head in a way that ensures everything moves smoothly together and the right volume of material is extruded at all points.<sup>3</sup><br />
<br />
To reverse the extruder by a given amount (for example to reduce its internal pressure while it does an in-air movement so that it doesn't dribble) simply use <code>G0</code> or <code>G1</code> to send an <code>E</code> value that is less than the currently extruded length.<br />
<br />
;Notes<br />
<sup>1</sup>Some firmwares allow for the RepRap to enable or disable the "sensing" of endstops during a move. Please check with whatever firmware you are using to see if they support the <code>H</code> parameter in this way, as damage may occur if you assume incorrectly. In RepRapFirmware, using the <code>H1</code> or <code>H2</code> parameter on a delta printer causes the <code>XYZ</code> parameters to refer to the individual tower motor positions instead of the head position, and to enable endstop detection as well if the parameter is H1.<br />
<br />
<sup>2</sup>In the RS274NGC Spec, <code>G0</code> is ''Rapid Move'', which was used to move between the current point in space and the new point as quickly and efficiently as possible, and <code>G1</code> is ''Controlled Move'', which was used to move between the current point in space and the new point as precise as possible. In RepRapFirmware, G1 is always a linear move but G0 may not be linear (e.g. on a SCARA machine); however a G0 move will never go below the lower of the initial and final Z height of the move.<br />
<br />
<sup>3</sup>Some firmwares may not support setting the feedrate inline with a move.<br />
<br />
<sup>4</sup>RepRapFirmware provides an additional 'R' parameter to tell the machine to add the coordinates of the specified restore point to all axis coordinates mentioned in the G0 or G1 command. Axes that are not mentioned in the G0 or G1 command are not moved. When a print is paused, the coordinates are saved in restore point #1. When a tool change is commenced, the coordinates are saved in restore point #2. Coordinates can also be saved in restore points explicity using the G60 command.<br />
<br />
Some older machines, CNC or otherwise, used to move faster if they did not move in a straight line. This is also true for some non-Cartesian printers, like delta or polar printers, which move easier and faster in a curve.<br />
<br />
==== G2 & G3: Controlled Arc Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | makerbot={{no}} | redeem={{experimental}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage:<br />
:<code>G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Clockwise Arc)''<br />
:<code>G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn</code> ''(Counter-Clockwise Arc)''<br />
;Parameters<br />
:<code>Xnnn</code> The position to move to on the X axis<br />
:<code>Ynnn</code> The position to move to on the Y axis<br />
:<code>Innn</code> The point in X space from the current X position to maintain a constant distance from<br />
:<code>Jnnn</code> The point in Y space from the current Y position to maintain a constant distance from<br />
:<code>Ennn</code> The amount to extrude between the starting point and ending point<br />
:<code>Fnnn</code> The feedrate per minute of the move between the starting point and ending point (if supplied)<br />
;Examples<br />
G2 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
G3 X90.6 Y13.8 I5 J10 E22.4<br />
(Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin Firmware not implemented for '''DELTA''' printers.<br />
<br />
<sup>2</sup>Prusa Firmware implements arcs only in Cartesian XY.<br />
<br />
<sup>3</sup>On Klipper, a <code>gcode_arcs</code> section must be enabled in the configuration file.<br />
<br />
==== G4: Dwell ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Pause the machine for a period of time.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Time to wait, in milliseconds (In Teacup, P0, wait until all previous moves are finished)<br />
:<code>Snnn</code> Time to wait, in seconds (Only on Repetier, Marlin, Prusa, Smoothieware, and RepRapFirmware 1.16 and later)<br />
;Example<br />
G4 P200<br />
<br />
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.<br />
<br />
On Marlin, Smoothie and RepRapFirmware, the "S" parameter will wait for seconds, while the "P" parameter will wait for milliseconds. "G4 S2" and "G4 P2000" are equivalent.<br />
<br />
==== G6: Direct Stepper Move ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G1 S2 or G1 H2 instead}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Perform a direct, uninterpolated, and non-kinematic synchronized move of one or more steppers directly. Units may be linear (e.g., mm or inches on <code>DELTA</code>) or specified in degrees (SCARA). This command is useful for initialization, diagnostics, and calibration, and should be disabled on production equipment. This type of move can be potentially dangerous, especially for deltabots, so implementations should do their best to limit movement to prevent twerking and damaging the carriage assembly.<br />
<br />
;Parameters<br />
:<code>Annn</code> Stepper A position or angle<br />
:<code>Bnnn</code> Stepper B position or angle<br />
:<code>Cnnn</code> Stepper C position or angle<br />
:<code>R</code> Relative move flag<br />
;SCARA Examples<br />
G6 A45 ; Move SCARA A stepper to the 45° position<br />
G6 B20 R ; Move SCARA B stepper 20° counter-clockwise<br />
;DELTA Example<br />
G6 C10 R ; Move DELTA C carriage up by 10mm<br />
<br />
==== G10: Set tool Offset and/or workplace coordinates and/or tool temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G10 Pnnn Xnnn Ynnn Znnn Rnnn Snnn</code><sup>1</sup><br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Lnnn</code> Offset mode (optional)<sup>5</sup><br />
:<code>Xnnn</code> X offset<br />
:<code>Ynnn</code> Y offset<br />
:<code>Znnn</code> Z offset<sup>2</sup><br />
:<code>U,V,W,A,B,Cnnn</code> other axis offsets<sup>4</sup><br />
:<code>Rnnn</code> Standby temperature(s) (RepRapFirmware)<br />
:<code>Snnn</code> Active temperature(s) (RepRapFirmware)<br />
;Examples<br />
G10 P2 X17.8 Y-19.3 Z0.0<br />
(sets the offset for tool 2 to the X, Y, and Z values specified)<br />
G10 P1 R140 S205<br />
(RepRapFirmware only - set standby and active temperatures<sup>3</sup> for tool 1)<br />
<br />
Remember that any parameter that you don't specify will automatically be set to the last value for that parameter. That usually means that you want explicitly to set Z0.0. RepRapFirmware will report the tool parameters if only the tool number is specified.<br />
<br />
The precise meaning of the X, Y (and other offset) values is: ''with no offset this tool is at this position relative to where a tool with offset (0, 0, 0) would be''. So if the tool is 10mm to the left of a zero-offset tool the X value would be -10, and so on.<br />
<br />
The <code>R</code> value is the standby temperature in <sup>o</sup>C that will be used for the tool, and the <code>S</code> value is its operating temperature. If you don't want the tool to be at a different temperature when not in use, set both values the same. See the [[G-code#T:_Select_Tool | T code (select tool)]] below. In tools with multiple heaters the temperatures for them all are specified thus: R100.0:90.0:20.0 S185.0:200.0:150.0 .<br />
<br />
See also <code>M585</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Marlin uses [[G-code#G10:_Retract|G10]]/[[G-code#G11:_Unretract|G11]] for executing a retraction/unretraction move. Smoothie uses <code>G10</code> for retract and <code>G10 Ln</code> for setting workspace coordinates. RepRapFirmware interprets a G10 command with no P or L parameter as a retraction command.<br />
<br />
<sup>2</sup>It's usually a bad idea to put a non-zero <code>Z</code> value in as well unless the tools are loaded and unloaded by some sort of tool changer or are on indepedent carriages. When all the tools are in the machine at once they should all be set to the same Z height.<br />
<br />
<sup>3</sup>If the absolute zero temperature (-273.15) is passed as active and standby temperatures, RepRapFirmware will only switch off the tool heater(s) without changing their preset active or standby temperatures. RepRapFirmware-dc42 does not support this setting.<br />
<br />
<sup>4</sup>Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your <code>M563</code> command to create the tool, you should specify a U offset not an X offset. If you map X to both X and U, you can specify both offsets.<br />
<br />
<sup>5</sup>L1 (the default) sets the offsets of the current tool relative to the head reference point to the specified values. L2 sets the current workplace coordinate offsets to the specified values. L20 adjusts the current workplace coordinate offsets so that the current tool head position has the specified coordinates.<br />
<br />
==== G10: Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G10<br />
<br />
Retracts filament according to settings of <code>M207</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
RepRapFirmware recognizes <code>G10</code> as a command to set tool offsets and/or temperatures if the <code>P</code> parameter is present, and as a retraction command if it is absent.<br />
<br />
==== G11: Unretract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}}: 0.92 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> retract length (S1 = long retract, S0 = short retract = default) (Repetier only)<br />
;Example<br />
G11<br />
<br />
Unretracts/recovers filament according to settings of <code>M208</code> (Marlin, RepRapFirmware) or according to the <code>S</code> value (Repetier).<br />
<br />
==== G12: Clean Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use a macro instead}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
[P<0|1>] [S<count>] [T<count>]<br />
:<code>G12 Pnnn Snnn Tnnn </code><br />
;Parameters<br />
:<code>Pnnn</code><sup>1</sup> Pattern style selection<br />
:<code>Snnn</code> Number of strokes (i.e. back-and-forth movements)<br />
:<code>Tnnn</code> Number of repetitions<br />
:<code>Ennn</code> 0=Never 1=Always apply software endstops (Marlin 2.0.6+)<br />
;Examples<br />
G12 ; stroke pattern (default)<br />
<br />
To generate a three triangle zig-zag pattern which will be stroked three times time use the following command.<br />
G12 P1 S3 T2 ; zig-zag pattern with 2 triangles<br />
<br />
;Notes<br />
<sup>1</sup>In Marlin firmware and Derivatives Mk4duo this is implemented by hard-coded firmware behaviours <br />
As defined for variables NOZZLE_CLEAN_STROKES, NOZZLE_CLEAN_START_POINT, NOZZLE_CLEAN_END_POINT and NOZZLE_CLEAN_PARK.<br />
<br />
With NOZZLE_CLEAN_PARK enabled, the nozzle will automatically return to the XYZ position after G12 is run.<br />
<br />
More on this behaviour is documented inside of the code base.<br />
<br />
The use of G12 for tool cleaning clashes with the established use of G12 for circular pocket milling on CNC machines. For this reason, RepRapFirmware does not support G12.<br />
<br />
==== G17..19: Plane Selection (CNC specific) ====<br />
{{Firmware Support | marlin={{yes}}:1.1.4 | prusa={{no}} | reprapfirmware={{partial|G17 only}} | grbl={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
These codes set the current plane as follows:<br />
* <code>G17</code> : XY (default)<br />
* <code>G18</code> : ZX<br />
* <code>G19</code> : YZ<br />
<br />
This mode applies to <code>G2</code>/<code>G3</code> arc moves. Normal arc moves are in the XY plane, and for most applications that's all you need. For CNC routing it can be useful to do small "digging" moves while making cuts, so to keep the G-code compact it uses <code>G2</code>/<code>G3</code> arcs involving the Z plane.<br />
<br />
These commands are supported in Marlin 1.1.4 and later with <code>ARC_SUPPORT</code> and <code>CNC_WORKSPACE_PLANES</code> enabled.<br />
<br />
==== G20: Set Units to Inches ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G20<br />
<br />
Units from now on are in inches. In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed.<br />
<br />
==== G21: Set Units to Millimeters ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot{{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G21<br />
<br />
Units from now on are in millimeters. (This is the RepRap default.)<br />
<br />
In RepRapFirmware, the inches/mm setting applies to regular printing and travel moves (G0, G1, G2 etc.) but not to configuration commands. Therefore configuration should be done in mm.<br />
<br />
When executing a macro file, RepRapFirmware remembers the initial inches/mm setting and restores it after execution of the macro has completed. So a macro file such as pause.g (executed when a pause command is received) can safely use G21 at the start to switch the units to mm without affecting the job after the macro completes, regardless of whether the job was using inches or mm.<br />
<br />
==== G22: Firmware Retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G10}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G22 ; Do a retract move</code><br />
<br />
Use this command (along with <code>G23</code>) to have the firmware to do retraction moves (in contrast to generating an E axis <code>G1</code> move). The retract length and speed are set in the firmware.<br />
<br />
==== G23: Firmware Recover ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G11}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G23 ; Do a recover move</code><br />
<br />
Use this command (along with <code>G22</code>) to have the firmware to do a recover move. The recover length and speed are set in the firmware.<br />
<br />
==== G26: Mesh Validation Pattern ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}: 1.1.0 | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G26 C P O2.25 ; Do a typical test sequence<br />
<br />
The <code>G26</code> Mesh Validation Pattern is designed to be used in conjunction with various Mesh Bed Leveling systems – those that adjust for an uneven —rather than just tilted— bed. The <code>G26</code> command prints a single layer pattern over the entire print bed, giving a clear indication of how accurately every mesh point is defined. <code>G26</code> can be used to determine which areas of the mesh are less-than-perfect and how much to adjust each mesh point.<br />
<br />
<code>G26</code> has large feature list, including a built-in test that extrudes material onto the bed. By default this is configured for PLA temperatures and a nozzle size of 0.4mm. (This will be adjustable in an upcoming version of Marlin.)<br />
<br />
See the [https://raw.githubusercontent.com/MarlinFirmware/Marlin/1.1.x/Marlin/G26_Mesh_Validation_Tool.cpp <code>G26_Mesh_Validation_Tool.cpp</code> file] in the Marlin source code for full documentation of the <code>G26</code> parameter list.<br />
<br />
==== G28: Move to Origin (Home) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}}<sup>1</sup> }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>X</code> Flag to go back to the X axis origin<br />
:<code>Y</code> Flag to go back to the Y axis origin<br />
:<code>Z</code> Flag to go back to the Z axis origin<br />
;Examples<br />
G28 ; Home all axes (On Prusa i3 MK2/s,MK2.5/s,MK3/s it will also perform mesh bed leveling)<sup>2</sup><br />
G28 X Z ; Home the X and Z axes<br />
<br />
When the firmware receives this command, it quickly moves the specified axes (or all axes if none are given) to the endstops, backs away from each endstop by a short distance, and slowly bumps the endstop again to increase positional accuracy. This process, known as "''Homing''", is required to determine the position of the print carriage(s). Some firmware may even forbid movement away from endstops and other operations until the axes have been homed.<br />
<br />
The <code>X</code>, <code>Y</code>, and <code>Z</code> parameters act only as flags. Any coordinates given are ignored. For example, <code>G28&nbsp;Z10</code> results in the same behavior as <code>G28&nbsp;Z</code>. Delta printers cannot home individual axes, but must always home all three towers, so the <code>X Y Z</code> parameters are simply ignored on these machines.<br />
<br />
Marlin firmware (version 1.1.0 and later) provides an option called <code>Z_SAFE_HOMING</code> for printers that use a Z probe to home Z instead of an endstop. With this option, the XY axes are homed first, then the carriage moves to a position –usually the middle of the bed– where it can safely probe downward to home Z.<br />
<br />
RepRapFirmware uses macro files to home either all axes or individual axes. If all axes are homed, the file <code>homeall.g</code> is processed. For individual axes the <code>homex.g</code>, <code>homey.g</code>, or <code>homez.g</code> file will be used. On Delta printers, <code>G28</code> command will always home all three towers by processing the <code>homedelta.g</code> file, regardless of any <code>X</code> <code>Y</code> <code>Z</code> parameters.<br />
<br />
Because the behavior of <code>G28</code> is unspecified, it is recommended '''not''' to automatically include <code>G28</code> in your ending G-code. On a Cartesian this will result in damaging the printed object. If you need to move the carriage at the completion of a print, use <code>G0</code> or <code>G1</code>.<br />
<br />
;Notes<br />
<sup>1</sup> MK4duo has a <code>B</code> parameter that tells the printer to return to the coordinates it was at before homing.<br /><br />
<sup>2</sup> Original Prusa i3 MK2/s, MK2.5/s, MK3/s supports a <code>W</code> parameter to suppress mesh bed leveling. If <code>W</code> is omitted, G28 will home only and NOT perform mesh bed leveling.<br />
Original Prusa i3 MK3/s (TMC2130 drivers) supports a <code>C</code> parameter to calibrate the X and Y home position.<br />
:<code>W</code> Suppress mesh bed leveling (Prusa MK2/s, MK2.5/s and MK3/s only)<sup>2</sup><br />
:<code>C</code> Calibrate X and Y home position (Prusa MK3/s only)<sup>2</sup><br />
<br />
==== G29: Detailed Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|G81}}<sup>1</sup> | repetier={{yes}}: 0.91.7 | smoothie={{no}}: see G32 | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command uses a probe to measure the bed height at 3 or more points to determine its tilt and overall flatness. It then enables compensation so that the nozzle will remain parallel to the bed. The printer must be homed with <code>G28</code> before using this command.<br />
<br />
Each firmware behaves differently and depends on the type of bed leveling that's been configured. For example, Marlin 1.0.2 provides 3 different types of automatic bed leveling (probe required) and a manual bed leveling option. See your firmware's documentation for the specific options available.<br />
<br />
;Usage<br />
:<code>G29</code><br />
:<code>G29 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> Firmware-dependent behavior<br />
:<code>Pfile.csv</code> Optional file name for bed height map file (RepRapFirmware only)<br />
;Examples<br />
G29 ; Probe the bed and enable compensation<br />
G29 S2 ; Special operation - see below<br />
G29 P1 ; UBL automated probe - see below<br />
<br />
===== G29 Auto Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin 1.0.2 and earlier provides three options for automatic bed leveling:<br />
* The 3-point method probes the bed at three points to produce a matrix, adjusting for a flat but tilted bed.<br />
* The planar grid method (non-Delta) probes a grid pattern to produce a matrix by the "least-squares" method, adjusting for a flat but tilted bed.<br />
* The bilinear grid method (Delta only) probes a grid pattern to produce a mesh, using bilinear interpolation to adjust for an uneven bed.<br />
<br />
Marlin 1.1.0 and later allows the bilinear grid (i.e., "mesh") method to be used on all types of machines, not just deltas. '''''This is the recommended leveling method going forward.'''''<br />
<br />
Also in Marlin 1.1.0 and later, the <code>PROBE_MANUALLY</code> option allows all forms of Auto Bed Leveling to be used without a probe. The procedure is similar to that of <code>MESH_BED_LEVELING</code> (see below). Begin the process with <code>G29</code> to move the nozzle to the first point. Adjust the Z axis using <code>G1</code> or your host software. Send <code>G29</code> again to move to the next point and repeat until all points have been sampled.<br />
<br />
;Parameters<br />
:<code>P</code> Set the size of the grid that will be probed (P x P points). Not supported by non-linear delta printer bed leveling. Example: <code>G29 P4</code><br />
:<code>S</code> Set the XY travel speed between probe points (in units/min)<br />
:<code>D</code> Dry-Run mode. Just evaluate the bed Topology - Don't apply or clean the rotation Matrix. Useful to check the topology after a first run of G29.<br />
:<code>V</code> Set the verbose level (0-4). Example: <code>G29 V3</code><br />
:<code>T</code> Generate a Bed Topology Report. Example: <code>G29 P5 T</code> for a detailed report. This is useful for manual bed leveling and finding flaws in the bed (to assist with part placement). Not supported by non-linear delta printer bed leveling.<br />
:<code>F</code> Set the Front limit of the probing grid<br />
:<code>B</code> Set the Back limit of the probing grid<br />
:<code>L</code> Set the Left limit of the probing grid<br />
:<code>R</code> Set the Right limit of the probing grid<br />
<br />
;Global Parameters:<br />
:<code>E</code> By default <code>G29</code> will engage the Z probe, test the bed, then disengage. Include <code>E</code> or <code>E1</code> to engage/disengage the Z probe for each sample. (This has no effect for fixed probes.)<br />
<br />
===== G29 Unified Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.1.0 and later) includes the <code>AUTO_BED_LEVELING_UBL</code> option for Unified Bed Leveling. UBL combines mesh leveling, tilted plane adjustment, 3-point leveling, and manual editing tools all together in a single package. To accomplish so much, UBL overloads `G29` with several new parameters and provides an additional <code>G26</code> Mesh Tuning feature.<br />
<br />
See the MarlinFW website for a dedicated [http://marlinfw.org/docs/features/unified_bed_leveling.html Unified Bed Leveling page] and complete documentation on [http://marlinfw.org/docs/gcode/G029-ubl.html `G29` for UBL] and [http://marlinfw.org/docs/gcode/G026.html `G26` Mesh Validation].<br />
<br />
;G29 UBL Parameters (synopsis):<br />
<pre><br />
A Activate Activate the Unified Bed Leveling system. (i.e., M420 S1)<br />
D Disable Disable the Unified Bed Leveling system. (i.e., M420 S0)<br />
<br />
B# Business Do Manual Probing in 'Business Card' mode.<br />
H# Height Height to raise the nozzle after each Manual Probe of the bed.<br />
<br />
C Continue Continue, Constant, or Current Location, depending on Phase.<br />
E Every Stow the probe after every sampled point.<br />
F# Fade Fade leveling compensation gradually, until it ceases at the given height.<br />
I# Invalidate Invalidate a specified number of Mesh Points (X and Y).<br />
J# Grid Do a grid (planar) leveling of the current Mesh using a grid with n points on a side.<br />
K# Kompare Compare (diff) current Mesh with stored Mesh #, replacing current Mesh with the result.<br />
<br />
L Load Load Mesh from the previously activated location in the EEPROM.<br />
L# Load Load Mesh from the specified location in the EEPROM.<br />
S Store Store the current Mesh in the Activated area of the EEPROM. Also save all settings.<br />
S # Store Store the current Mesh at the specified area in EEPROM, set as the Activated area.<br />
S -1 Store Store the current Mesh as a print-out suitable to be fed back into the system.<br />
<br />
O Map Display the Mesh Map Topology.<br />
<br />
P0 Phase 0 Zero Mesh Data and turn off the Mesh Compensation System.<br />
P1 Phase 1 Invalidate the Mesh and do Automatic Probing to generate new Mesh data.<br />
P2 Phase 2 Probe unpopulated areas of the Mesh (those that couldn't be auto-probed).<br />
P3 Phase 3 Fill unpopulated Mesh points with a fixed value. No 'C' for "smart fill" extrapolation.<br />
P4 Phase 4 Fine tune the Mesh. ** Delta Mesh Compensation requires an LCD panel. **<br />
P5 Phase 5 Find Mean Mesh Height and Standard Deviation.<br />
P6 Phase 6 Shift Mesh height. All Mesh points are adjusted by the amount specified with 'C'.<br />
<br />
Q Test Load specified Test Pattern to help check system operation.<br />
<br />
R # Repeat Repeat the command the specified number of times. Default: grid points X * Y.<br />
<br />
T 3-Point Perform a 3-Point Bed Leveling on the current Mesh.<br />
<br />
U Unlevel Perform a probe of the outer perimeter to assist in physically leveling the bed.<br />
<br />
W What? Print a report of Unified Bed Leveling stored data.<br />
<br />
X # The X location for the command<br />
Y # The Y location for the command<br />
<br />
Z Zero Do a single probe to set the Z Height of the nozzle.<br />
Z # Zero Raise/lower the entire Mesh to conform with the specified difference (plus zprobe_zoffset).<br />
</pre><br />
<br />
===== G29 Manual Bed Leveling (Marlin - MK4duo) =====<br />
<br />
Marlin firmware (version 1.0.2 and later) also provides a <code>MESH_BED_LEVELING</code> feature that can be used to perform bed leveling on machines lacking a probe. This form of bed leveling compensates for uneven Z height across the surface of the bed using a mesh and bilinear interpolation.<br />
<br />
;Manual Bed Leveling Usage<br />
G29 S1 ; Move to the first point and wait for a measurement<br />
G29 S2 ; Store the current Z, move to the next point<br />
G29 S3 Xn Yn Zn.nn ; Modify the Z height of a single point<br />
<br />
;Options for the <code>S</code> parameter<br />
:<code>S0</code> Produces a mesh report<br />
:<code>S1</code> Start probing mesh points<br />
:<code>S2</code> Probe the next mesh point<br />
:<code>S3 Xn Yn Zn.nn</code> Manually modify a single point<br />
:<code>S4 Zn.nn</code> Set z offset. Positive away from bed, negative closer to bed.<br />
<br />
===== G29 Auto Bed Leveling (Repetier-Firmware) =====<br />
<br />
Repetier firmware since v0.91 supports <code>G29</code> with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use <code>G32</code> instead with firmware 0.92.8 and above.<br />
:<code>S0</code> Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing <code>G29</code>.<br />
:<code>S1</code> Same as <code>S0</code>, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue <code>G28 Z</code> to home to Z maximum position before issuing <code>G29 Snnn</code> for this to work correctly, or the printer height will be invalid.<br />
:<code>S2</code> Same as <code>S1</code>, except new calculated Z height is also stored to EEPROM.<br />
<br />
===== G29 Mesh Bed Compensation (RepRapFirmware) =====<br />
<br />
RepRapFirmware:<br />
:<code>S0</code> (default if no <code>S</code> parameter) Probe the bed, save the height map in a file on the SD card, and activate the height map. The default folder for the height map file is <code>/sys</code> and the default file name is <code>heightmap.csv</code>.<br />
:<code>S1</code> Load the height map from file and activate bed compensation. The default folder and filename as for <code>S0</code>.<br />
:<code>S2</code> Clear the currently-loaded bed height map<br />
To define the grid, see [[G-code#M557:_Set_Z_probe_point_or_define_probing_grid|M557]].<br />
<br />
;Notes<br />
In Prusa Firmware <code>G29</code> is not active by default, instead [[G-code#G81:_Mesh_bed_leveling_status|G81]] is used.<sup>1</sup><br />
<br />
==== G29.1: Set Z probe head offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M851}} | prusa={{no|M851}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no|M851}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.1 X30 Y20 Z0.5<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves.<br />
<br />
==== G29.2: Set Z probe head offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G29.2 Z0.0<br />
<br />
Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G29.2</code> command.<br />
<br />
==== G30: Single Z-Probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|G28,G92}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Usage<br />
:<code>G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Hnnn</code> Height correction<br />
:<code>Snnn</code> Set parameter<br />
;Example<br />
G30<br />
;Examples (RepRapFirmware)<br />
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.<br />
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.<br />
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0<br />
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration<br />
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors<br />
<br />
In its simplest form probes bed at current XY location.<br />
<br />
RepRapFirmware supports additional behaviour: if a <code>Pn</code> field is specified the probed <code>X</code>, <code>Y</code>, and <code>Z</code> values are saved as point n on the bed for calculating the offset plane or for performing delta printer calibration. If <code>X</code>, <code>Y</code>, or <code>Z</code> values are specified (e.g. <code>G30 P1 X20 Y50 Z0.3</code>) then those values are used instead of the machine's current coordinates. A silly <code>Z</code> value (less than -9999.0) causes the machine to probe at the current point to get Z, rather than using the given value. If an S field is specified (e.g. <code>G30 P1 Z0.3 S</code>) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using <code>G1</code> commands, and then probe the bed, or for the user to position the nozzle interactively and use those coordinates. The user can also record those values and place them in a setup G-code file for automatic execution.<br />
<br />
RepRapFirmware uses the value of the <code>S</code> parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.<br />
<br />
RepRapFirmware supports an optional <code>H</code> parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the <code>Z</code> parameter of the <code>G31</code> command in the config.g file. When you probe using <code>G30</code> and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the <code>H</code> parameter.<br />
<br />
<sup>1</sup>MK4duo Firmware support an optional parameter for Delta.<br />
;Usage<br />
:<code>G30 Xnnn Ynnn S Z P</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Sn</code> Stows the probe if 1 (default=1)<br />
:<code>Zn</code> <bool> with a non-zero value will apply the result to current delta_height<br />
:<code>Pn</code> <bool> with a non-zero value will apply the result to current zprobe_zoffset<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>2</sup><br />
<br />
==== G31: Set or Report Current Probe status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}}: 0.91.7 | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn</code><br />
;Parameters<br />
:<code>Pnnn</code> Trigger value<br />
:<code>Xnnn</code> Probe X offset<sup>1</sup><br />
:<code>Ynnn</code> Probe Y offset<sup>1</sup><br />
:<code>Znnn</code> Trigger Z height<br />
:<code>Cnnn</code> Temperature coefficient<sup>2</sup><br />
:<code>Snnn</code> Calibration temperature<sup>2</sup><br />
:<code>Tnnn</code> (RepRapFirmware 1.17 and later) Z probe type to which these parameters apply, defaults to the current Z probe type as defined by <code>M558 P</code> parameter<br />
;Examples<br />
G31 P500 Z2.6<br />
G31 X16.0 Y1.5<br />
<br />
When used on its own this reports whether the Z probe is triggered, or gives the Z probe value in some units if the probe generates height values. If combined with a Z and P field (example: <code>G31 P312 Z0.7</code>) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a <code>G28 Z0</code> (zero Z axis) command is sent. The machine will then move a further -0.7mm in Z to place itself at Z = 0. This allows non-contact measuring probes to approach but not touch the bed, and for the gap left to be allowed for. If the probe is a touch probe and generates a simple 0/1 off/on signal, then <code>G31 Z0.7</code> will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.<br />
<br />
In RepRapFirmware, separate <code>G31</code> parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a [[G-code#M558:_Set_Z_probe_type|M558]] command to select the probe type before sending the <code>G31</code> command, or use the <code>T</code> parameter.<br />
<br />
In Repetier, <code>G31</code> supports no parameters and simply prints the high/low status of the Z probe.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset.<br />
<br />
<sup>2</sup>In RepRapFirmware, additional parameters 'S' (bed temperature in <sup>o</sup>C at which the specified <code>Z</code> parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of <code>Z</code> parameter in mm/<sup>o</sup>C, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature. This facility is deprecated and likely to be removed in a future version of RepRapFirmware.<br />
<br />
==== G31: Dock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G32: Probe Z and calculate Z plane ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|G29}} | prusa={{no|G29}} | repetier={{yes|0.92.8+}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
G32 ; Probe and calculate<br />
G32 Snnn ; Each firmware has its own parameters<br />
G32 Snnn Pnnn ; Refer to their specific documentation<br />
<br />
This command is implemented as a more sophisticated form of bed leveling (which uses a transformation matrix or motorized correction. Smoothieware uses this code instead of [[#G29:_Detailed_Z-Probe|`G29`]].<br />
<br />
Each firmware behaves differently. For example, Repetier firmware allows for motorized rotation of the bed whilst ReprapFirmware probes the bed with a transformation matrix.<br />
<br />
===== Probe and calculate in Reprapfirmware =====<br />
<br />
RepRapFirmware executes macro file <code>bed.g</code> in response to the G31 command. The <code>bed.g</code> file is typically used to probe the bed and then perform delta calibration if the printer is a delta, or to perform individual leadscrew adjustment to level the bed if the printer has multiple independently-controlled Z motors, or to advise the user on how much to adjust each bed levelling adjustment screw.<br />
<br />
===== Probe and calculate in Repetier firmware =====<br />
<br />
This command probes the bed at 3 or more pre-defined points and implements bed leveling compensation by either moving the A axis during printing (as with regular bed leveling, <code>G29</code>) or by tilting the bed with motors.<br />
<br />
;Parameters<br />
:<code>Snnn</code> Bed leveling method<br />
:<code>Pnnn</code> Bed correction method<br />
<br />
The values for Snnn and Pnnn are as follows:<br />
:<code>S0</code> This method measures at the 3 probe points and creates a plane through these points. If you have a really planar bed this gives the optimum result. The 3 points must not be in one line and have a long distance to increase numerical stability.<br />
:<code>S1</code> This measures a grid. Probe point 1 is the origin and points 2 and 3 span a grid. We measure BED_LEVELING_GRID_SIZE points in each direction and compute a regression plane through all points. This gives a good overall plane if you have small bumps measuring inaccuracies.<br />
:<code>S2</code> Bending correcting 4 point measurement. This is for cantilevered beds that have the rotation axis not at the side but inside the bed. Here we can assume no bending on the axis and a symmetric bending to both sides of the axis. So probe points 2 and 3 build the symmetric axis and point 1 is mirrored to 1m across the axis. Using the symmetry we then remove the bending from 1 and use that as plane.<br />
:<code>P0</code> Use a rotation matrix. This will make z axis go up/down while moving in x/y direction to compensate the tilt. For multiple extruders make sure the height match the tilt of the bed or one will scratch. This is the default.<br />
:<code>P1</code> Motorized correction. This method needs a bed that is fixed on 3 points from which 2 have a motor to change the height. The positions are defined in firmware by BED_MOTOR_1_X, BED_MOTOR_1_Y, BED_MOTOR_2_X, BED_MOTOR_2_Y, BED_MOTOR_3_X, BED_MOTOR_3_Y Motor 2 and 3 are the one driven by motor driver 0 and 1. These can be extra motors like Felix Pro 1 uses them or a system with 3 z axis where motors can be controlled individually like the Sparkcube does. This method requires a Z max endstop.<br />
<br />
==== G32: Undock Z Probe sled ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G33: Firmware dependent ====<br />
<br />
===== G33: Measure/List/Adjust Distortion Matrix (Repetier - Redeem) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92.8+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Lnnn</code><br />
:<code>G33 Rnnn</code><br />
:<code>G33 Xnnn Ynnn Znnn</code><br />
;Parameters<br />
:<code>L0</code> List distortion matrix in a report<br />
:<code>R0</code> Reset distortion matrix<br />
:<code>X[pos] Y[pos] Z[zCorrection]</code> Set correction for nearest point<br />
;Examples<br />
G33<br />
G33 R0<br />
<br />
When used with no parameters, <code>G33</code> will measure a grid of points and store the distortion dips and valleys in the bed surface, and then enable software distortion correction for the first few or several layers. The values will be stored in EEPROM if enabled in firmware. You must previously have <code>G28</code> homed, and your Z minimum/maximum height must be set correctly for this to work. Use the optional parameters to list, reset or modify the distortion settings. Distortion correction behavior can be later turned on or off by code <code>M323</code>.<br />
<br />
===== G33: Delta Auto Calibration (Marlin 1.1.x - MK4duo)=====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G32}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
End-stops and tower angle corrections are normalized '''(P0)'''; <br />
<br />
Performs a 1-4-7 point calibration of delta height '''(P1)''', end-stops, delta radius '''(P2)''' and tower angle corrections '''(P>=3)''' by a least squares iteration process based on the displacement method.<br />
<br />
;Usage<br />
:<code>G33</code><br />
:<code>G33 Pn T Cx.xx Fn Vn E</code><br />
;Parameters<br />
:<code>Pn</code> Number of probe points: n*n (n= 0-10), when P is omitted the default set in Configuration.h is used.<br />
:<code>T</code> Do not calibrate tower angle corrections (if used with P>=3); do not use the probe points near the towers, but the probe points opposite to the towers (if used with P=2)<br />
:<code>Cx.xx</code> Force the iterations to stop when a standard deviation from the zero plane less then x.xx mm is achieved; when C is omitted the iterations go on until the best possible standard deviation is reached.<br />
:<code>Fn</code> Force to run at least n iterations (n=1-30) and take the best result<br />
:<code>Vn</code> Verbose level: (n=0-3) 0 = dry run without calibration; 1(default) = settings at start and end; 2 = settings at all iterations; 3 = settings and probe results<br />
:<code>E</code> Engage the probe for each point<br />
;Examples<br />
'''''G33 : calibrates with the default settings.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
Iteration : 01 std dev:0.306<br />
Iteration : 02 std dev:0.049<br />
Iteration : 03 std dev:0.033<br />
Iteration : 04 std dev:0.031<br />
Calibration OK rolling back.<br />
.Height:297.69 Ex:-0.10 Ey:-0.12 Ez:+0.00 Radius:100.91<br />
.Tower angle : Tx:-0.03 Ty:+0.25 Tz:+0.00<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P6 V0 : probes 36 points in dry run mode.'''''<br />
G33 Auto Calibrate<br />
Checking... AC (DRY-RUN)<br />
.Height:297.77 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
.Tower angle : Tx:+0.00 Ty:+0.00 Tz:+0.00<br />
. c:+0.03 x:+0.32 y:+0.34 z:+0.41<br />
. yz:+0.37 zx:+0.32 xy:+0.17<br />
End DRY-RUN std dev:0.306<br />
<br />
'''''G33 P4 C0.05 T : probes 16 points and'''''<br />
'''''stops when a standard deviation of 0.05mm is reached;'''''<br />
'''''calibrates delta height, endstops and delta radius,'''''<br />
'''''leaves the tower angle corrections unaltered.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.317<br />
Iteration : 02 std dev:0.059<br />
Calibration OK std dev:0.042<br />
.Height:297.66 Ex:-0.17 Ey:-0.13 Ez:+0.00 Radius:100.91<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P2 : probes center and tower positions and'''''<br />
'''''calibrates delta height, endstops and delta radius.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:297.78 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:100.00<br />
Iteration : 01 std dev:0.374<br />
Iteration : 02 std dev:0.054<br />
Iteration : 03 std dev:0.007<br />
Calibration OK rolling back.<br />
.Height:297.68 Ex:-0.14 Ey:-0.14 Ez:+0.00 Radius:101.23<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
'''''G33 P1 : probes the center and calibrates the delta height only.'''''<br />
G33 Auto Calibrate<br />
Checking... AC<br />
.Height:261.40 Offset:+0.30<br />
Calibration OK std dev:0.000<br />
.Height:261.58 Offset:+0.10<br />
Save with M500 and/or copy to Configuration.h<br />
<br />
''note: Height = delta height; Ex, Ey, Ez = end-stop corrections; Radius = delta radius; Tx, Ty, Tz = tower angular corrections; c, x, y, z, yz, zx, xy = probe results at center, towers and opposite to towers; std dev = standard deviation of the probe results towards the zero plane.''<br />
<br />
==== G34: Z Stepper Auto-Align ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M671 and G32}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Use multiple Z steppers and a probe to align Z axis connection points. See <code>M422</code> for other options.<br />
<br />
;Example<br />
G34 I3 T0.8 A1.5 ; 3 iterations, Target Accuracy 0.8, Amplification 1.5<br />
<br />
==== G34: Calculate Delta Height from toolhead position (DELTA) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G34<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>G34</code> command.<br />
This value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
==== G38.x Straight Probe (CNC specific) ====<br />
===== G38.2 probe toward workpiece, stop on contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.3 probe toward workpiece, stop on contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{yes}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
===== G38.4 probe away from workpiece, stop on loss of contact, signal error if failure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
===== G38.5 probe away from workpiece, stop on loss of contact =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{yes}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G40: Compensation Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | machinekit={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G40</code> turns off cutter compensation. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.<br />
http://www.linuxcnc.org/docs/2.5/html/gcode/tool_compensation.html<br />
<br />
==== G42: Move to Grid Point ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
<code>G42</code> does a fast move in XY to any of the intersection points in the bed calibration grid. This is useful during calibration to align the nozzle or probe.<br />
<br />
;Parameters<br />
:<code>Inn</code> Grid X index (zero-based). If omitted, the nearest latitude.<br />
:<code>Jnn</code> Grid Y index (zero-based). If omitted, the nearest longitude.<br />
:<code>P</code> Probe flag. Moves the probe to the grid point (instead of the nozzle).<br />
:<code>Fnnn</code> Feedrate (mm/m)<br />
;Example<br />
G42 I3 J4 P F3000 ; Move the probe to grid coordinate 3, 4<br />
<br />
==== G53..59: Coordinate System Select (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
See [http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g54-g59.3 linuxcnc.org] for more help<br />
<br />
Not all builds of RepRapFirmware support these commands. For those that do (e.g. Duet WiFi/Ethernet and Duet 3), from firmware version 2.02 the workplace coordinate offsets are included in the data saved to config-override.g by the M500 command.<br />
<br />
==== G60: save current position to slot ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | makerbot={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G60 Snn</code><br />
;Parameters<br />
:<code>Snn</code> <nn> specifies memory slot # (0-based) to save into (default 0)<br />
Implementation in RepRapFirmware:<br />
*Slots 0, 1 and 2 are available from RepRapFirmware 1.21, also slots 4 and 5 in RRF 2.02. When a print is paused the coordinates are saved to slot 1 automatically, and at the start of a tool change the coordinates are saved to slot 2 automatically. Use G0 or G1 with the R0, R1 or R2 parameter to move the current tool to a saved position.<br />
<br />
==== G61: Apply/restore saved coordinates to the active extruder. ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{yes|Use G0 or G1 with R parameter}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Usage<br />
:<code>G61 Xnnn Ynnn Znnn Ennn Fnnn Snn</code><br />
;Parameters<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
:<code>Znnn</code> Z coordinate<br />
:<code>Ennn</code> E coordinate<br />
:<code>Fnnn</code> F Set Feedrate<br />
:<code>Snn</code> S specifies memory slot # (0-based)<br />
<br />
==== G75: Print temperature interpolation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Show/print PINDA temperature interpolating.<br />
<br />
;Usage<br />
:<code>G75</code><br />
<br />
==== G76: PINDA probe temperature calibration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}}<sup>1</sup> | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).<br />
<br />
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.<br />
<br />
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.<br />
<br />
<br />
;Usage<br />
:<code>G76</code><br />
:<code>G76 B</code><sup>1</sup><br />
:<code>G76 P</code><sup>1</sup><br />
<br />
;Parameters<br />
:<code>B</code> Calibrate bed only <sup>1</sup><br />
:<code>P</code> Calibrate probe only <sup>1</sup><br />
<br />
;Example<br />
G76<br />
<br />
echo PINDA probe calibration start<br />
echo start temperature: 35.0°<br />
echo ...<br />
echo PINDA temperature -- Z shift (mm): 0.---<br />
<br />
;Notes<sup>1</sup><br />
Marlin requires <code>PROBE_TEMP_COMPENSATION</code>.<br />
<br />
This process can take a very long time. The timeout is currently set to 15min to allow the parts to fully heat up and cool down.<br />
<br />
Use <code>M500</code> to save the result to EEPROM.<br />
<br />
At this moment it is only supported in Marlin bugfix-2.0.x branch.<br />
<br />
==== G80: Cancel Canned Cycle (CNC specific) ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
It cancel canned cycle modal motion.<br />
G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.<br />
<br />
==== G80: Mesh-based Z probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G29}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{partial|G29}} | yaskawa={{no}} }}<br />
<br />
Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>N</code> Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.<br />
:<code>R</code> Probe retries. Default 3 max. 10<br />
:<code>V</code> Verbosity level 1=low, 10=mid, 20=high.It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active.<br />
<br />
Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.<br />
:<code>L</code> Left Bed Level correct value in um.<br />
:<code>R</code> Right Bed Level correct value in um.<br />
:<code>F</code> Front Bed Level correct value in um.<br />
:<code>B</code> Back Bed Level correct value in um.<br />
<br />
==== G81: Mesh bed leveling status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M420}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Prints mesh bed leveling status and bed profile if activated.<br />
<br />
;Usage<br />
:<code>G81</code><br />
<br />
;Notes<br />
Equivalent to <code>M420 V</code> in Marlin Firmware (and possibly [[G-code#G29:_Detailed_Z-Probe|G29 T]] depending on leveling system).<br />
<br />
==== G82: Single Z probe at current location ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|G30}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!<br />
<br />
;Usage<br />
:<code>G82</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G83: Babystep in Z and store to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G83</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G84: UNDO Babystep Z (move Z axis back) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} <sup>1</sup>| smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G84</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G85: Pick best babystep ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G85</code><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== G86: Disable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the start of a calibration script.<br />
<br />
;Usage<br />
:<code>G86</code><br />
<br />
==== G87: Enable babystep correction after home ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-code will be performed at the end of a calibration script.<br />
<br />
;Usage<br />
:<code>G87</code><br />
<br />
==== G88: Reserved ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}}<sup>1</sup> | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G88</code><br />
<br />
;Notes<br />
This G-code currently does not do anything.<br />
<br />
==== G90: Set to Absolute Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G90<br />
<br />
All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.)<br />
<br />
==== G91: Set to Relative Positioning ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | grbl={{yes}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
G91<br />
<br />
All coordinates from now on are relative to the last position. Note: RepRapFirmware latest revision firmware uses <code>M83</code> to set the extruder to relative mode: extrusion is NOT set to relative by ReprapFirmware on <code>G91</code>: only X,Y and Z are set to relative. By contrast, Marlin (for example) DOES also set extrusion to relative on a <code>G91</code> command, as well as setting X, Y and Z.<br />
<br />
==== G92: Set Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | grbl={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Xnnn</code> new X axis position<br />
:<code>Ynnn</code> new Y axis position<br />
:<code>Znnn</code> new Z axis position<br />
:<code>Ennn</code> new extruder position<br />
;Example<br />
G92 X10 E90<br />
<br />
Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.<br />
<br />
A <code>G92</code> without coordinates will reset all axes to zero on some firmware. This does not apply to RepRapFirmware.<br />
<br />
===== G92.x: Reset Coordinate System Offsets (CNC specific) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|1.1.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>G92.1</code> - Reset axis offsets (and parameters 5211-5219) to zero. (<code>X Y Z A B C U V W</code>)<br />
:<code>G92.2</code> - Reset axis offsets to zero<br />
<br />
==== G93: Feed Rate Mode (Inverse Time Mode) (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{yes}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
<code>G93</code> is Inverse Time Mode. In inverse time feed rate mode, an <code>F</code> word means the move should be completed in (one divided by the <code>F</code> number) minutes.<br />
For example, <code>F2.0</code> means the move should be completed in a half a minute.<br />
<br />
When the inverse time feed rate mode is active, an <code>F</code> word must appear on every line which has a <code>G1</code>, <code>G2</code>, or <code>G3</code> motion, and an <code>F</code> word on a line that does not have <code>G1</code>, <code>G2</code>, or <code>G3</code> is ignored. Being in inverse time feed rate mode does not affect <code>G0</code> (rapid move) motions.<br />
<br />
==== G94: Feed Rate Mode (Units per Minute) (CNC specific) ====<br />
{{Firmware Support | reprapfirmware={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
G94 is Units per Minute Mode. In units per minute feed mode, an F word is interpreted to mean the controlled point should move at a certain number of inches per minute, millimeters per minute, or degrees per minute, depending upon what length units are being used and which axis or axes are moving.<br />
<br />
==== G98: Activate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable Prusa-specific Farm functions and g-code.<br />
<br />
;Usage<br />
<code>G98</code><br />
<br />
;Notes<br />
Set of internal Prusa commands<br />
<br />
<code>PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]</code><br />
<br />
<br />
;Parameters<br />
:<code>Ping</code><br />
:<code>PRN</code> Prints revision of the printer.<br />
:<code>FAN</code> Prints fan details.<br />
:<code>fn</code> Prints farm number.<br />
:<code>thx</code><br />
:<code>uvlo</code> Resets UVLO aka Power Panic and continues SD print.<br />
:<code>fsensor_recover</code> Filament sensor recover - restore print and continue.<br />
:<code>MMURES</code> Reset MMU.<br />
:<code>Reset</code> Resets Printer.<br />
:<code>fv</code> ??? get file version. ???<br />
:<code>M28</code> M28 write to SD.<br />
:<code>SN</code> Get serial number from 32U2 processor. Typical format of S/N is:CZPX0917X003XC13518<br />
:<code>Fir</code> Prints firmware version.<br />
:<code>Rev</code> Prints filament size, elelectronics, nozzle type.<br />
:<code>Lang</code> Reset the language.<br />
:<code>Lz</code> ??? maybe resets Live Z values to 0 ???<br />
:<code>Beat</code> Kick farm link timer.<br />
:<code>FR</code> Full factory reset.<br />
:<code>nozzle set 'diameter' </code> Set nozzle diameter.<br />
:<code>nozzle D'diameter'</code> Check nozzle diameter.<br />
:<code>nozzle</code> Print nozzle diameter<br />
<br />
==== G99: Deactivate farm mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
<code>G99</code><br />
<br />
==== G100: Calibrate floor or rod radius ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | klipper={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to set floor for X axis<br />
:<code>Y</code> Flag to set floor for Y axis<br />
:<code>Z</code> Flag to set floor for Z axis<br />
:<code>Rnnn</code> Radius to add<br />
;Examples<br />
G100 X Y Z ; set floor for argument passed in. Number ignored and may be absent.<br />
G100 R5 ; Add 5 to radius. Adjust to be above floor if necessary<br />
G100 R0 ; Set radius based on current z measurement. Moves all axes to zero<br />
<br />
==== G130: Set digital potentiometer value ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G130 X10 Y18 Z15 A20 B12<br />
<br />
Set the digital potentiometer value for the given axes. This is used to configure the current applied to each stepper axis. The value is specified as a value from 0-127; the mapping from current to potentimeter value is machine specific.<br />
<br />
==== G131: Remove offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G132: Calibrate endstop offsets ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G133: Measure steps to top ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes|0.91+}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== G161: Home axes to minimum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its minimum position<br />
:<code>Y</code> Flag to home the Y axis to its minimum position<br />
:<code>Z</code> Flag to home the Z axis to its minimum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G161 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their minimum position. Similar to <code>G28</code>, which decides on its own in which direction to search endstops.<br />
<br />
==== G162: Home axes to maximum ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | grbl={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X</code> Flag to home the X axis to its maximum position<br />
:<code>Y</code> Flag to home the Y axis to its maximum position<br />
:<code>Z</code> Flag to home the Z axis to its maximum position<br />
:<code>Fnnn</code> Desired feedrate for this command<br />
;Example<br />
G162 X Y Z F1800<br />
<br />
Instruct the machine to home the specified axes to their maximum position.<br />
<br />
==== G425: Perform auto-calibration with calibration cube ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | klipper={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This performs an automatic calibration of backlash, positional errors and nozzle offset by<br />
touching the nozzle on the sides of a bed mounted, electrically conductive cube, washer or bolt.<br />
<br />
;Parameters<br />
:<code>B</code> Perform calibration of backlash only.<br />
:<code>Tnnn</code> Perform calibration of toolhead only.<br />
:<code>V</code> Probe cube and print position, error, backlash and hotend offset.<br />
:<code>Unnn</code> Uncertainty, how far to start probe away from the cube (mm)<br />
<br />
;Examples (Marlin)<br />
G425 ; Perform full calibration sequence<br />
T1 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T1<br />
T0 ; Switch to second nozzle<br />
G425 V ; Validate by showing report for T0<br />
<br />
== M-commands ==<br />
<br />
==== M0: Stop or Unconditional stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>3</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{yes}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Time to wait, in milliseconds<sup>1</sup><br />
:<code>Snnn</code> Time to wait, in seconds<sup>2</sup><br />
;Example<br />
M0<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also <code>M1</code>, <code>M112</code>.<br />
<br />
The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.<br />
<br />
RepRapFirmware executes cancel.g if this file is present, if the print is paused and if the axes are homed. Otherwise stop.g is run and the drives are put into idle mode. Also the heaters are turned off if no 'H1' parameter is specified.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Not available in RepRapFirmware, but as a work-around <code>G4</code> can be run before <code>M0</code>.<br />
<br />
<sup>2</sup>Only available on Marlin and Prusa Firmware.<br />
<br />
<sup>3</sup>"Wait for user ..." is shown on LCD in Prusa Firmware.<br />
<br />
==== M1: Sleep or Conditional stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | makerbot={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M1<br />
<br />
The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also <code>M0</code>, <code>M112</code>.<br />
<br />
The Marlin and Prusa Firmware do the same as <code>M0</code>.<br />
<br />
If Marlin is emulated in RepRapFirmware, this does the same as [[G-code#M25:_Pause_SD_print|M25]] if the code was read from a serial or Telnet connection, else the macro file <code>sleep.g</code> is run before all heaters and drives are turned off.<br />
<br />
==== M2: Program End ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M2<br />
<br />
Teacup firmware does the same as <code>M84</code>.<br />
<br />
==== M3: Spindle On, Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Spindle RPM<br />
;Example<br />
M3 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
Teacup firmware turn extruder on (same as <code>M101</code>).<br />
<br />
RepRapFirmware interprets this code only if in CNC mode (<code>M453</code>), in laser mode (<code>M452</code>) or if a Roland mill has been configured. You must always provide an S parameter with this command to specify the required spindle speed pr laser power. In RepRapFirmware 2.05RC2 and later, and RepRapFirmware 3.0beta13 and later, in laser mode (M452) the laser will only fire during G1/G2/G2 moves.<br />
<br />
In Repetier-Firmware in laser mode you need <code>S0</code>..<code>S255</code> to set laser intensity. Normally you use <code>S255</code> to turn it on full power for moves. Laser will only fire during <code>G1</code>/<code>G2</code>/<code>G3</code> moves and in laser mode (<code>M452</code>).<br />
<br />
==== M4: Spindle On, Counter-Clockwise (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M4 S4000<br />
<br />
The spindle is turned on with a speed of 4000 RPM.<br />
<br />
==== M5: Spindle Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M5<br />
<br />
The spindle is turned off.<br />
<br />
Teacup firmware turn extruder off (same as <code>M103</code>).<br />
<br />
==== M6: Tool change ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M6<br />
<br />
==== M7: Mist Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M7<br />
<br />
Mist coolant is turned on (if available)<br />
<br />
Teacup firmware turn on the fan, and set fan speed (same as <code>M106</code>).<br />
<br />
==== M8: Flood Coolant On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M8<br />
<br />
Flood coolant is turned on (if available)<br />
<br />
==== M9: Coolant Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M9<br />
<br />
All coolant systems are turned off.<br />
<br />
==== M10: Vacuum On (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M10<br />
<br />
Dust collection vacuum system turned on.<br />
<br />
==== M11: Vacuum Off (CNC specific) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M106 | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M11<br />
<br />
Dust collection vacuum system turned off.<br />
<br />
==== M13: Spindle on (clockwise rotation) and coolant on (flood) ====<br />
{{Firmware Support | fived={{???}} | teacup={{???}} | sprinter={{???}} | marlin={{no}} | prusa={{no}} | repetier={{???}} | reprapfirmware={{???}} | smoothie={{???}} | bfb={{???}} | machinekit={{???}} | redeem={{???}} | mk4duo={{???}} | yaskawa={{yes}} }}<br />
<br />
This one M-code does the work of both M03 and M08. It is not unusual for specific machine models to have such combined commands, which make for shorter, more quickly written programs.<br />
<br />
;Example<br />
M13<br />
<br />
==== M16: Expected Printer Check ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1=(2.0+)}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Do a case-sensitive comparison between the string argument and the configured <code>MACHINE_NAME</code>. If the machine name doesn't match, halt the printer so that a reset is required. This safety feature is meant to prevent G-code sliced for a specific machine from being used on any other machine. In Marlin this feature is enabled with <code>EXPECTED_PRINTER_CHECK</code>.<br />
<br />
;Example<br />
M16 Cookie Monster<br />
<br />
==== M17: Enable/Power all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=(automatic)}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> All extruders<br />
<br />
;Example<br />
M17<br />
M17 X E0<br />
<br />
Powers on stepper motors.<br />
<br />
;Notes<br />
<sup>1</sup>Ability to specify axes was added to Marlin 2.0 and may not be available on other firmware implementations.<br />
<br />
==== M18: Disable all stepper motors ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}}: Use M2 | sprinter={{no}} | marlin={{yes|M84}} | prusa={{yes|M84}}<sup>3</sup> | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup><sup>3</sup>''<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<sup>3</sup><br />
;Examples<br />
M18<br />
M18 X E0<br />
<br />
Disables stepper motors and allows axes to move 'freely.'<br />
<br />
On Marlin, <code>M18</code> is a synonym of <code>M84</code>, so it can also be used to configure or disable the idle timeout.<br />
<br />
;Examples<br />
M18 S10 ; Idle steppers after 10 seconds of inactivity<br />
M18 S0 ; Disable idle timeout<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Some firmware implementations do not support parameters to be passed, but at least Marlin and RepRapFirmware do.<br />
<br />
<sup>2</sup>RepRapFirmware allows stepper motors to be disabled selectively. For example, <code>M18 X E0:2</code> will disable the X, extruder 0 and extruder 2 motors.<br />
<br />
<sup>3</sup>In Prusa Firmware this command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)<br />
<br />
==== M20: List SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}}<sup>1,2</sup> | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Snnn</code> Output style<sup>1</sup><br />
:<code>Pnnn</code> Directory to list<sup>2</sup><br />
;Examples<br />
M20<br />
M20 S2 P"/gcodes/subdir"<br />
<br />
This code lists all files in the root folder or G-code directory of the SD card to the serial port. One name per line, like:<br />
<br />
ok<br />
SQUARE.G<br />
SQCOM.G<br />
ZCARRI~2.GCO<br />
CARRIA~1.GCO<br />
<br />
On Marlin, a file list response is usually encapsulated. Standard configurations of RepRapFirmware mimic this style in emulation mode:<br />
<br />
Begin file list:<br />
SQUARE.G<br />
ZCARRI~2.GCO<br />
End file list<br />
ok<br />
<br />
If RepRapFirmware emulates no firmware compatibility, a typical response looks like:<br />
<br />
G-code files:<br />
"Traffic cone.g","frog.gcode","calibration piece.g"<br />
<br />
Note that some firmwares list file names in upper case, but - when sent to the <code>M23</code> command (below) they must be in lower case. Teacup and RepRapFirmware have no such trouble and accept both. RepRapFirmware always returns long filenames in the case in which they are stored.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>If the S2 parameter is used on RepRapFirmware, then the file list is returned in JSON format as a single array called "files" with each name that corresponds to a subdirectory preceded by an asterisk, and the directory is returned in variable "dir".<br />
<br />
;Example<br />
M20 S2 P/gcodes<br />
{"dir":"\/gcodes","files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"]}<br />
<br />
<sup>2</sup>This parameter is only supported by RepRapFirmware and defaults to the 0:/gcodes directory, which is the directory that printable gcode files are normally stored in.<br />
<br />
<sup>3</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M21: Initialize SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M21<br />
M21 P1<br />
<br />
The specified SD card is initialized. If an SD card is loaded when the machine is switched on, this will happen by default. SD card must be initialized for the other SD functions to work.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M22: Release SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> SD card number (RepRapFirmware only, default 0)<br />
;Examples<br />
M22<br />
M22 P1<br />
<br />
The specified SD card is released, so further (accidental) attempts to read from it are guaranteed to fail. Helpful, but not mandatory before removing the card physically.<br />
<br />
==== M23: Select SD file ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M23 filename.gco<br />
<br />
The file specified as filename.gco (8.3 naming convention is supported) is selected ready for printing. RepRapFirmware supports long filenames as well as 8.3 format.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M24: Start/resume SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M24<br />
<br />
The machine prints from the file selected with the <code>M23</code> command. If the print was previously paused with <code>M25</code>, printing is resumed from that point. To restart a file from the beginning, use <code>M23</code> to reset it, then <code>M24</code>.<br />
<br />
When this command is used to resume a print that was paused, RepRapFirmware runs macro file <code>resume.g</code> prior to resuming the print.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M25: Pause SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M25<br />
<br />
The machine pauses printing at the current position within the file. To resume printing, use [[G-code#M24:_Start.2Fresume_SD_print|M24]]. Do not use this code within a GCode file to pause the print at that point, use [[G-code#M226:_Gcode_Initiated_Pause|M226]] instead.<br />
<br />
Prior to pausing, RepRapFirmware runs macro file <code>pause.g</code>. This allows the head to be moved away from the print, filament to be retracted, etc.<br />
<br />
RepRapFirmware 1.20 and later also save the current state of the print to file /sys/resurrect.g. This is so that if the printer is turned off after pausing, the print can subsequently be resumed.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M26: Set SD position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{partial|aborts}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> File position from start of file in bytes<br />
:<code>Pnnn</code> (Optional, RepRapFirmware only) Proportion of the first move to be skipped, default 0.0, must be less than 1.0<br />
;Example<br />
:M26 S49315<br />
<br />
Set the file offset in bytes from the start of the SD card file selected by M23. The offset must correspond to the start of a G-code command.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M27: Report SD print status ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>1</sup> | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''C''' Report the open file's name and long name (Marlin 1.1.9 and up)<br />
: '''Sn''' Set the auto-report interval (Marlin 1.1.9 and up)<br />
<br />
;Example<br />
M27<br />
<br />
Report SD print status.<br />
<br />
Marlin and RepRapFirmware report the number of bytes processed in this format, which can be processed by Pronterface:<br />
<br />
SD printing byte 2134/235422<br />
<br />
If no file is being printed, only this message is reported:<br />
<br />
Not SD printing.<br />
<br />
In Marlin 1.1.9 and up <code>M27 C</code> reports the open file's DOS 8.3 name and long filename, if any.<br />
<br />
;Example<br />
M27 C<br />
<br />
Current file: filena~1.gco Filenagotcha.gcode<br />
<br />
In Marlin 1.1.9 and up <code>M27 Sn</code> sets the auto-report interval. This requires the <code>AUTO_REPORT_SD_STATUS</code> configuration option to be enabled. Marlin reports this capability in <code>M115</code> as <code>Cap: AUTO_REPORT_SD_STATUS 1</code> when this option is available.<br />
<br />
;Example<br />
M27 S2 ; Report the SD card status every 2 seconds<br />
<br />
;Notes<br />
<br />
<sup>1</sup>On Klipper, a virtual SD card is required for this to work.<br />
<br />
==== M28: Begin write to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M28 filename.gco<br />
<br />
File specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file.<br />
<br />
==== M29: Stop writing to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M29 filename.gco<br />
<br />
File opened by <code>M28</code> command is closed, and all subsequent commands sent to the machine are executed as normal.<br />
<br />
;Notes<br />
<sup>1</sup>Prusa firmware accepts this code but currently has no effect.<br />
<br />
==== M30: Delete a file on the SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} || marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
> M30 filename.gco<br />
> filename.gco is deleted.<br />
<br />
===== M30: Program Stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} || marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | grbl={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
- For Yaskawa and in grbl <br />
- Same as M2 in Yaskawa G-code<br />
<br />
;Example<br />
M30 ; Exchange pallet shuttles and end the program. Pressing cycle start will start the program at the beginning of the file.<br />
<br />
==== M31: Output time since last <code>M109</code> or SD card start to serial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M31<br />
<br />
The response looks like:<br />
<br />
echo:54 min, 38 sec<br />
<br />
==== M32: Select file and start SD print ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M32 filename.gco<br />
<br />
It can be used when printing from SD card and does the same as <code>M23</code> and <code>M24</code>.<br />
<br />
tba available in marlin(14/6/2014)<br />
<br />
==== M33: Get the long name for an SD card file or folder ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no|Not required}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get the long name for a file or folder on the SD card from a dos path. Introduced in Marlin firmware 1.1.0 September 2015.<br />
<br />
==== M33: Stop and Close File and save restart.gcode ====<br />
{{Firmware Support | reprapfirmware={{no}}: Use M25 | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Stop the printing from SD and save all position in restart.gcode for restart printing in future<br />
<br />
==== M34: Set SD file sorting options ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable and disable SD card file-sorting, and/or set the folder sorting order. Proposed by Marlin firmware, May 2015.<br />
<br />
==== M35: Upload firmware NEXTION from SD ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | mk4duo={{yes}} }}<br />
<br />
==== M36: Return file information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M36 filename.gco<br />
<br />
Returns information for the specified SD card file in JSON format. A sample response is:<br />
<br />
{"err":0,"size":436831,"lastModified":"2017-09-21T16:58:07","height":5.20,"firstLayerHeight":0.20,"layerHeight":0.20,"printTime":660,"simulatedTime":1586,"filament":[1280.7],"generatedBy":"Simplify3D(R) Version 4.0.0"}<br />
<br />
The "err" field is zero if successful, nonzero if the file was not found or an error occurred while processing it. The "size" field should always be present if the operation was successful. The presence or absence of other fields depends on whether the corresponding values could be found by reading the file. The "filament" field is an array of the filament lengths required from each spool. The size is in bytes, the times are in seconds, all other values are in mm. 'printTime' is the printing time estimated by the slicer, 'simulationTime' is the time measured when the print was simulated by the firmware. The fields may appear in any order, and additional fields may be present.<br />
<br />
If the file name parameter is not supplied and a file on the SD card is currently being printed, then information for that file is returned including additional field "fileName". This feature is used by the web interface and by PanelDue, so that if a connection is made when a file is already being printed, the name and other information about that file can be shown.<br />
<br />
==== M37: Simulation mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
: '''S1''' Enter simulation mode<br />
: '''S0''' Leave simulation mode<br />
: '''P"filename"''' (optional) Simulate printing a file from SD card<br />
; Examples<br />
: M37 S1<br />
: M37 P"MyModel.g"<br />
<br />
Used to switch between printing mode and simulation mode. Simulation mode allows the electronics to compute an accurate printing time, taking into account the maximum speeds, accelerations etc. that are configured.<br />
<br />
M37 S1 enters simulation mode. All G and M codes will not be acted on, but the time they would take to execute will be calculated.<br />
<br />
M37 S0 leaves simulation mode and prints the total time taken by simulated moves since entering simulation mode.<br />
<br />
M37 with no S parameter prints the time taken by the simulation, from the time it was first entered using M37 S1, up to the current point (if simulation mode is still active) or the point that the simulation was ended (if simulation mode is no longer active).<br />
<br />
M37 P"filename" enters simulation mode, prints the specified file, exits simulation mode, reports the print time, and appends it to the G-code file as a comment for later retrieval.<br />
<br />
==== M38 Compute SHA1 hash of target file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Used to compute a hash of a file on the SD card. Examples:<br />
<br />
> M38 gcodes/myfile.g<br />
> Cannot find file<br />
> M38 www/reprap.htm<br />
> 91199139dbfadac15a18cfb962dfd4853db83999<br />
<br />
Returns a hexadecimal string which is the SHA1 of the file. If the file cannot be found, then the string "Cannot find file" is returned instead.<br />
<br />
==== M39 Report SD card information ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}}: 1.20.1 and later | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' SD slot number, default 0<br />
:'''Sn''' Response format. S0 returns a plain text response, S2 returns a response in JSON format.<br />
;Examples<br />
:'''M39''' ; report information for SD card 0 in plain text format<br />
:'''M39 P1 S2''' ; report information for SD card 1 in JSON format<br />
<br />
This command returns information about the SD card in the specified slot in the requested format. At least the following is returned:<br />
* Whether or not a usable card is present in the slot<br />
* The capacity of the card in bytes (if a card is present)<br />
* The amount of free space on the card in bytes (if a card is present)<br />
<br />
The JSON response has the following format (more fields may be added in future):<br />
<br />
{"SDinfo":{"slot":0,"present":1,"capacity":4294967296,"free":2147485184,"speed":20971520,"clsize":32768}}<br />
<br />
The capacity, free space and cluster size are in bytes, and the interface speed is in bytes/second.<br />
<br />
==== M40: Eject ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If your RepRap machine can eject the parts it has built off the bed, this command executes the eject cycle. This usually involves cooling the bed and then performing a sequence of movements that remove the printed parts from it. The X, Y and Z position of the machine at the end of this cycle are undefined (though they can be found out using the <code>M114</code> command, q.v.).<br />
<br />
See also <code>M240</code> and <code>M241</code> below.<br />
<br />
==== M41: Loop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|No, use 'while' command}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M41<br />
<br />
If the RepRap machine was building a file from its own memory such as a local SD card (as opposed to a file being transmitted to it from a host computer) this goes back to the beginning of the file and runs it again. So, for example, if your RepRap is capable of ejecting parts from its build bed then you can set it printing in a loop and it will run and run. Use with caution - the only things that will stop it are:<br />
<br />
# When you press the reset button,<br />
# When the build material runs out (if your RepRap is set up to detect this), and<br />
# When there's an error (such as a heater failure).<br />
<br />
==== M42: Switch I/O pin ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Pin number<br />
:<code>Snnn</code> Pin value<br />
;Example<br />
M42 P7 S255<br />
<br />
<code>M42</code> switches a general purpose I/O pin. Use <code>M42 Px Sy</code> to set pin x to value y, when omitting Px the LEDPIN will be used.<br />
<br />
In Teacup, general purpose devices are handled like a heater, see [[#M104: Set Extruder Temperature | M104]].<br />
<br />
In Marlin Firmware, pin numbers for 32-bit processors are in the form PORT * 100 + PIN. So pin P1_02 on LPC1768 can be set with <code>M42 P102 S1</code>.<br />
<br />
Marlin 1.x includes an <code>I</code> parameter to permit setting "volatile" pins that Marlin is using.<br />
<br />
Marlin 2.0.5.2 and up include the <code>M</code> parameter to set the pin mode: 0=INPUT, 1=OUTPUT, 2=INPUT_PULLUP, 3=INPUT_PULLDOWN.<br />
<br />
In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see [[Duet pinout]]. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|16||TXD1||11<br />
|-<br />
|17||RXD1||12<br />
|-<br />
|18||TXD0||13<br />
|-<br />
|19||RXD0||14<br />
|-<br />
|20||TWD1||35<br />
|-<br />
|21||TWCK1||36<br />
|-<br />
|23||PA14||10<br />
|-<br />
|36||PC4||18<br />
|-<br />
|52||AD14||41<br />
|-<br />
|67||PB16||32<br />
|}<br />
<br />
In firmware 1.16, the pin numbering has changed.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
|60||PA10/RXD0||14<br />
|-<br />
|61||PA11/TXD0||13<br />
|-<br />
|62||PA12/RXD1||12<br />
|-<br />
|63||PA13/TXD1||11<br />
|-<br />
|64||PA14/RTS1||10<br />
|-<br />
|65||PB12/TWD1||35<br />
|-<br />
|66||PB13/TWCK1||36<br />
|-<br />
|67||PB16/DAC1*||32<br />
|-<br />
|68||PB21/AD14||41<br />
|-<br />
|69||PC4||18<br />
|}<br />
<br />
* Also used as CS signal on external SD card socket<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping<br />
! style="width: 50px;" | P<br />
! Signal Name<br />
! style="width: 50px;" | Expansion Connector Label <br />
! Expansion Pin<br />
|-<br />
|60||CS5||CS5||50<br />
|-<br />
|61||CS6||E3_STOP||9<br />
|-<br />
|62||CS7||E4_STOP||14<br />
|-<br />
|63||CS8||E5_STOP||19<br />
|}<br />
<br />
See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins] for all pin definitions.<br />
<br />
Pre-1.16 example:<br />
M42 P20 S1 ;set the connector pin 35 to high.<br />
<br />
On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:<br />
<br />
5 TIOA6,<br />
6 PWML7,<br />
39 PWMH2,<br />
58 AD3,<br />
59 AD2,<br />
66 DAC0,<br />
67 DAC1,<br />
68 CANRX0,<br />
69 CANTX0,<br />
70 SDA1,<br />
71 SCL1,<br />
72 RX LED,<br />
73 TX LED.<br />
<br />
See also <code>M583</code>.<br />
<br />
==== M43: Stand by on material exhausted ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{partial|M600}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M43<br />
<br />
If your RepRap can detect when its material runs out, this decides the behaviour when that happens. The X and Y axes are zeroed (but not Z), and then the machine shuts all motors and heaters off except the heated bed, the temperature of which is maintained. The machine will still respond to G and M code commands in this state.<br />
<br />
==== M43: Pin report and debug ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M43 En Pnnn Wn In</code><br />
;Parameters<br />
:<code>En</code> Enable / disable background endstop monitoring<br />
:<code>Pnnn</code> Pin to read or watch. If omitted, read/watch all pins<br />
:<code>Wn</code> bool watch pins -reporting changes- until reset, click, or <code>M108</code><br />
:<code>In</code> bool Flag to ignore pin protection<br />
<br />
; Note<br />
: You must have <code>PINS_DEBUGGING</code> uncommented in your <code>Configuration_adv.h</code> file for M43 to work.<br />
<br />
==== M44: Codes debug - report codes available ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | grbl={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | makerbot={{no}} | yaskawa={{no}} }}<br />
<br />
In MK4duo you must enable <code>FASTER_GCODE_EXECUTE</code> to get this G-code.<br />
<br />
;Parameters<br />
:<code>In</code> G-code list<br />
:<code>Jn</code> M-code list<br />
<br />
==== M44: Reset the bed skew and offset calibration ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M45: Bed skew and offset with manual Z up ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
;Parameters<br />
:<code>Vnn</code> Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional. <br />
<br />
==== M46: Show the assigned IP address ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M552}} | prusa={{yes}} }}<br />
<br />
Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
At this moment it is deactivated.<br />
<br />
==== M47: Show end stops dialog on the display ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M48: Measure Z-Probe repeatability ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> number of points<br />
:<code>Xnnn</code> position on the X axis<br />
:<code>Ynnn</code> position on the Y axis<br />
:<code>Vnnn</code> verbosity<br />
:<code>E</code> engage<br />
:<code>Lnnn</code> legs of travel<br />
:<code>S</code> schizoid<br />
<br />
As with <code>G29</code>, the E flag causes the probe to stow after each probe.<br />
<br />
The S flag will result is a random sized, 5 pointed star, being traced (X and Y axis) between each sample. Usually a user will get worse repeat-ability numbers with S specified because the X axis and Y axis movements will add to the machine's positioning errors.<br />
<br />
<br />
;Prusa specific <sup>1</sup><br />
This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and need to be regenerated.<br />
<br />
The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.<br />
;Usage<br />
<code>M48 nAA Xnnnn Ynnnn Vn Lnn</code><br />
;Parameters<br />
:<code>nAA</code> number(AA) of samples, default=10 (valid values between 4 and 50)<br />
:<code>Xnnn</code> X position for samples<br />
:<code>Ynnn</code> Y position for samples<br />
:<code>Vn</code> Verbosity level 1-4 (low to highest)<br />
:<code>Lnn</code> Legs of travel 1-15<br />
<br />
==== M49: Set G26 debug flag ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:M49 S1 ; Enable G26 verbose debug output<br />
<br />
==== M70: Display message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M117}} | prusa={{no}} | repetier={{no|M117}} | smoothie={{no|M117}} | reprapfirmware={{no|M117}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M117}} | mk4duo={{no}} | yaskawa={{no|M117}} }}<br />
<br />
;Example<br />
M70 P200 Message<br />
<br />
Display a message on the LCD. <code>P</code> is the time to display message for.<br />
<br />
==== M72: Play a tone or song ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M300}} | prusa={{no|M300}} | repetier={{no}} | reprapfirmware={{no|M300}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}}: See M300 }}<br />
<br />
;Example<br />
M72 P2<br />
<br />
Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.<br />
<br />
==== M73: Set/Get build percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M73 P50<br />
<br />
Tell the firmware the current build progress percentage. The machine is expected to display this on its display. If the percentage is exactly 0 a "Build Start" notification is sent to the host. If the percentage is exactly 100 a "Build End" notification is sent to the host.<br />
<br />
Use "M73" by itself to get a report of the current print progress.<br />
<br />
;Prusa specific<sup>1</sup><br />
Prusa firmware just shows percent done and time remaining.<br />
;Usage<br />
<code>M73 P R Q S</code><br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>P</code> Percent in normal mode<br />
:<code>R</code> Time remaining in normal mode<br />
:<code>Q</code> Percent in silent mode<br />
:<code>S</code> Time remaining in silent mode<br />
;Examples<br />
M73<br />
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"<br />
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"<br />
<br />
==== M75: Start the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M76: Pause the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M77: Stop the print job timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M78: Show statistical information about the print jobs ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M80: ATX Power On ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M80 ; Turn on the power supply<br />
M80 S ; Report power supply state (Marlin 1.1.1)<br />
<br />
Turns on the ATX power supply from standby mode to fully operational mode. No-op on electronics without standby mode.<br />
<br />
;Notes<br />
* Marlin requires the <code>POWER_SUPPLY</code> configuration option to be set to a non-zero value to enable <code>M80</code>.<br />
* Some firmwares (e.g., [[Teacup Firmware | Teacup]]) handle power on/off automatically, so this is redundant there. Also, see [http://forums.reprap.org/read.php?219,132664 RAMPS wiring for ATX on/off].<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set.<sup>1</sup><br />
<br />
==== M81: ATX Power Off ====<br />
{{Firmware Support | fived={{no}} | teacup=automatic | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P''' quit the daemon (redeem only)<br />
:'''R''' restart the daemon (redeem only)<br />
:'''Sn''' n=0 turn power off immediately (default), n=1 turn power off when all thermostatic fans have turned off (RepRapFirmware 1.20 and later only)<br />
;Examples<br />
:M81 ; turn power off immediately<br />
:M81 S1 ; turn power off when everything has cooled down (RepRapFirmware)<br />
<br />
Turns off the ATX power supply. Counterpart to <code>M80</code>.<br />
<br />
;Notes<br />
* Prusa requires <code>defined (PS_ON_PIN)</code> and <code>PS_ON_PIN</code> must be set to Power off.<sup>1</sup><br />
<br />
==== M82: Set extruder to absolute mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M82<br />
<br />
Makes the extruder interpret extrusion as absolute positions.<br />
<br />
This is the default in repetier and for Yaskawa controllers.<br />
<br />
==== M83: Set extruder to relative mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M83<br />
<br />
Makes the extruder interpret extrusion values as relative positions.<br />
<br />
Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.<br />
<br />
==== M84: Stop idle hold ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}}<sup>3</sup> | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Innn</code> Reset flags<sup>1</sup><br />
;Example<br />
M84<br />
<br />
Stop the idle hold on all axis and extruder. In some cases the idle hold causes annoying noises, which can be stopped by disabling the hold. Be aware that by disabling idle hold during printing, you will get quality issues. This is recommended only in between or after printjobs.<br />
<br />
On Marlin, Repetier and RepRapFirmware, <code>M84</code> can also be used to configure or disable the idle timeout. For example, "M84 S10" will idle the stepper motors after 10 seconds of inactivity. "M84 S0" will disable idle timeout; steppers will remain powered up regardless of activity.<br />
For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware-dc42 and other firmware may not support this parameter.<br />
<br />
<sup>2</sup>Prusa firmware uses <code>M84</code> similar to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
<sup>3</sup>On Klipper <code>M84</code> is equivalent to [[G-code#M18:_Disable_all_stepper_motors]]<br />
<br />
;Prusa Usage<br />
:<code>M84 E S X Y Z</code><br />
<br />
;Prusa Parameters<br />
:''This command can be used without any additional parameters.<sup>2</sup>''<br />
:<code>E</code> Extruder drive(s)<sup>2</sup><br />
:<code>S</code> Seconds<br />
:<code>X</code> X axis<br />
:<code>Y</code> Y axis<br />
:<code>Z</code> Z axis<br />
<br />
==== M85: Set Inactivity Shutdown Timer ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M85 S30<br />
<br />
Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)<br />
<br />
==== M86: Set Safety Timer expiration time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
;Usage<br />
:<code>M86 Snnnn</code><br />
;Parameters<br />
:<code>S</code> Seconds<br />
Similar to <code>M85</code> but applies to the "safety timer" in Prusa Firmware.<br />
<br />
Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.<br />
<br />
When safety timer expires, heatbed and nozzle target temperatures are set to zero.<br />
<br />
==== M92: Set axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Steps per unit for the X drive<br />
:<code>Ynnn</code> Steps per unit for the Y drive<br />
:<code>Znnn</code> Steps per unit for the Z drive<br />
:<code>Ennn</code> Steps per unit for the extruder drive(s)<br />
:<code>Snnn</code> Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.<sup>1</sup><br />
;Examples<br />
M92 X87.489 Y87.489 Z87.489<br />
M92 E420:420<br />
<br />
Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (<code>M500</code> in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.<br />
<br />
RepRapFirmware will report the current steps/mm if you send <code>M92</code> without any parameters.<br />
For Yaskawa systems M92/M93 is not applicable due to use of servo motors.<br />
<br />
;Notes<br />
<sup>1</sup> Only available in RepRapFirmware >=2.03<br />
<br />
==== M93: Send axis_steps_per_unit ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin ={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M92}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M98: Call Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Macro filename. In RepRapFirmware 3 this must be enclosed in double-quote characters. In RepRapFirmware 2 the double-quote characters are optional.<br />
;Example<br />
M98 Pmymacro.g<br />
M98 P"mymacro.g"<br />
<br />
Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the <code>P</code> parameter normally refers to a line number in the program itself (P2000 would run the Macro starting at line O2000, say). For RepRap, which almost always has some sort of mass storage device inbuilt, it simply refers to the name of a G-code file that is executed by the <code>G98</code> call. That G-code file does not need to end with an <code>M99</code> (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.<br />
<br />
Certain machine parameters are saved at the start of the macro call and restored at the end. For RepRapFirmware these are: axis movement relative/absolute mode, extruder movement absolute/relative mode, feed rate, inches/mm setting, and whether or not volumetric extrusion is selected. This allows the macro to change these settings without affecting the subsequent behaviour of the calling file.<br />
<br />
RepRapFirmware also allows the filename to include a path to a subdirectory. For relative paths, the default folder is /sys, but some implementations may check the /macros directory too. Absolute file paths are supported by RepRapFirmware too.<br />
<br />
==== M99: Return from Macro/Subprogram ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{yes}} }}<br />
<br />
;Example<br />
M99<br />
<br />
Returns from an <code>M98</code> call.<br />
<br />
RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.<br />
<br />
==== M101: Turn extruder 1 on (Forward), Undo Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to <code>M103</code>.<br />
<br />
In BFB/RapMan:<br />
Turn extruder on (forward/filament in).<br />
<br />
In RepRapFirmware: undo filament retraction. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares:<br />
Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M102: Turn extruder 1 on (Reverse) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder on Reverse (Still to add)<br />
<br />
In other firmwares:<br />
Deprecated.<br />
<br />
==== M103: Turn all extruders off, Extruder Retraction ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}: 1.17c and later | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In Teacup firmware:<br />
If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to <code>M101</code>.<br />
<br />
In BFB/RapMan firmware:<br />
Turn extruder off.<br />
<br />
In RepRapFirmware: retract filament. The length and speed are set by the <code>M207</code> command. RepRapFirmware supports this command for compatibility with Simplify3D.<br />
<br />
In other firmwares: Deprecated. Regarding filament retraction, see <code>G10</code>, <code>G11</code>, <code>M207</code>, <code>M208</code>, <code>M227</code>, <code>M228</code>, <code>M229</code>.<br />
<br />
==== M104: Set Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Display temperature (Only Prusa)<br />
:<code>Snnn</code> Target temperature<br />
:<code>Rnnn</code> Idle temperature (Only MK4duo)<br />
<br />
;Example<br />
M104 S190<br />
M104 S190 R170<br />
<br />
Set the temperature of the current extruder to 190<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the extruder). See also [[G-code#M109:_Set_Extruder_Temperature_and_Wait|M109]].<br />
<br />
See also using [[G-code#G10:_Set_tool_Offset_and.2For_workplace_coordinates_and.2For_tool_temperatures|G10]]. Deprecation of <code>M104</code> is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]]. --[[User:Traumflug|Traumflug]] 11:33, 19 July 2012 (UTC)<br />
<br />
===== M104 in Marlin Firmware =====<br />
<br />
See [http://marlinfw.org/docs/gcode/M104.html Marlin Wiki]. In Marlin Firmware, using <code>M104</code> with no parameters will turn off the heater for the current extruder. This is also the case for <code>M104 S</code> without a number after the <code>S</code> parameter.<br />
<br />
===== M104 in Teacup Firmware =====<br />
<br />
In Teacup Firmware, <code>M104</code> can be additionally used to handle all devices using a temperature sensor. It supports the additional <code>P</code> parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see [[#M106: Fan On | M106]].<br />
<br />
;Example<br />
M104 P1 S100<br />
<br />
Set the temperature of the device attached to the second temperature sensor to 100°C.<br />
<br />
===== M104 in RepRapFirmware and Klipper =====<br />
<br />
RepRapFirmware and some other firmwares support the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command applies to.<br />
<br />
==== M105: Get Extruder Temperature ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | makerbot={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
;Examples<br />
M105<br />
<br />
Request the temperature of the current extruder, the build base and the build chamber in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command can look like:<br />
<br />
ok T:201 B:117<br />
ok T:201 /202 B:117 /120<br />
ok T:201 /202 B:117 /120 C:49.3 /50<br />
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50<br />
ok T0:110 /110 T1:23 /0 B:117 /120<br />
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4<br />
<br />
The parameters mean the following:<br />
<br />
* T, T0, ..., Tn - extruder temperature. In a single extruder setup, only T will be reported. Some firmware variants will report no T0 in multi extruder setups - in that case T is to be considered the temperature of the first tool. Otherwise, T should be considered the temperature of the currently selected tool (which will be repeated in one of the Tn entries)<br />
* B - bed temperature<br />
* C - chamber temperature<br />
* @ - Hotend power<br />
* B@ - Bed power<br />
* P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)<sup>1</sup><br />
* A - Ambient actual (Prusa MK3/s only)<sup>1</sup><br />
A temperature report will usually include actual and target temperature for all available heaters, with the format being "actual/target" or - for some firmware variants - "actual /target". During a blocking heatup some firmware variants only report the temperature tuple for the heater that is currently in blocking heatup state.<br />
<br />
Note that temperatures can be reported as integers or floats. There sadly are a lot of interpretations of how an M105 response should look like across firmware variants, making parsing them potentially tricky.<br />
<br />
Expansion/generalization of <code>M105</code> to be considered using S1 parameter as noted in [[Pronterface I/O Monitor]]<br />
<br />
In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:<br />
<pre><br />
M105 X0<br />
==> 11:05:48.910 : T:23.61 /0 @:0 T0:23.61 /0 @0:0 RAW0:3922 T1:23.89 /0 @1:0 RAW1:3920<br />
</pre><br />
<br />
Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.<br />
<br />
==== M106: Fan On ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Fan number (optional, defaults to 0)<sup>2</sup><br />
:<code>Snnn</code> Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))<br />
;Extra Parameters<br />
:<code>Innn</code> Invert signal, or disable fan<sup>1</sup> <sup>3</sup><br />
:<code>Fnnn</code> Set fan PWM frequency, in Hz<sup>1</sup> <sup>3</sup><br />
:<code>Lnnn</code> Set minimum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Xnnn</code> Set maximum fan speed (0 to 255 or 0.0 to 1.0)<sup>1</sup> <sup>3</sup><br />
:<code>Bnnn</code> Blip time - fan will be run at full PWM for this number of seconds when started from standstill<sup>1</sup><br />
:<code>Hnn:nn:nn...</code> Select heaters monitored when in thermostatic mode<sup>1</sup> <sup>3</sup><br />
:<code>Rnnn</code> Restore fan speed to the value it has when the print was paused<sup>1</sup><br />
:<code>Tnnn</code> Set thermostatic mode trigger temperature<br />
:<code>Cnnn</code> Set custom name (RRF > 2.01 only)<sup>1</sup><br />
;Example<br />
M106 S127<br />
;Examples (RepRapFirmware)<br />
M106 P1 I1 S87<br />
M106 P1 T45 H1:2<br />
M106 P2 B0.1 L0.05<br />
<br />
The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.<br />
<br />
Mandatory parameter 'S' declares the PWM value (0-255). <code>M106 S0</code> turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: <code>M106 S0.7</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>These parameters are only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Marlin 1.0 to 1.1.6 only supports a single fan. Marlin 1.1.7 and up supports up to 3 fans.<br />
<br />
<sup>3</sup>These parameters are only available in MK4duo.<br />
<br />
===== M106 in RepRapFirmware =====<br />
<br />
If an <code>S</code> parameter is provided but no other parameter is present, then the speeds of the print cooling fans associated with the current tool will be set (see the <code>F</code> parameter in the <code>M563</code> command). If no tool is active then the speed of Fan 0 will be set. Either way, the speed is remembered so that it can be recalled using the <code>R2</code> parameter (see below).<br />
<br />
If no <code>S</code> parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the <code>R2</code> parameter is used, then the speeds of the print cooling fans associated with the current tool will be set to the remembered value (see above).<br />
<br />
The <code>T</code> and <code>H</code> parameters allow a fan to be configured to operate in thermostatic mode, for example to use one of the fan channels to control the hot end fan. In this mode the fan will be fully on when the temperature of any of the heaters listed in the <code>H</code> parameter is at or above the trigger temperature set by the <code>T</code> parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.<br />
<br />
The <code>B</code> parameter sets the time for which the fan will be operated at full PWM when started from cold, to allow low fan speeds t be used. A value of 0.1 seconds is usually sufficient.<br />
<br />
The <code>L</code> parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.<br />
The <code>X</code> parameter defines the maximum PWM value that is allowed for this fan. If a higher value is commanded, it will be rounded down to this value.<br />
<br />
The <code>I</code> parameter causes the fan output signal to be inverted if its value is greater than zero. This makes the cooling fan output suitable for feeding the PWM input of a 4-wire fan via a diode. If the parameter is present and zero, the output is not inverted. If the <code>I</code> parameter is negative then in RRF 1.16 and later the fan is disabled, which frees up the pin for use as a general purpose I/O pin that can be controlled using <code>M42</code>.<br />
<br />
===== M106 in Teacup Firmware =====<br />
<br />
Additionally to the above, Teacup Firmware uses <code>M106</code> to control general devices. It supports the additional <code>P</code> parameter, which is an zero-based index into the list of heaters/devices in config.h.<br />
<br />
;Example<br />
M106 P2 S255<br />
<br />
Turn on device #3 at full speed/wattage.<br />
<br />
'''Note''': When turning on a temperature sensor equipped heater with <code>M106</code> and <code>M104</code> at the same time, temperature control will override the value given in <code>M106</code> quickly.<br />
<br />
''Note well:'' '''The ambiguous text in the note above needs to be reworded by someone who knows the actual functioning. Below is my interpretation based on language use, not practical experience or code inspection.'''<br />
<br />
'''Note:''' ''If <code>M104</code> is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any <code>M106</code> initiated control output value change in the time it takes for the PID (of other feedback) loop to adjust it back to minimum error. It may not be easy to observe a change in the temperature (process value) due to this brief change in the control value''<br />
<br />
==== M107: Fan Off ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Deprecated in Teacup firmware and in RepRapFirmware. Use <code>M106 S0</code> instead.<br />
<br />
==== M108: Cancel Heating ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | prusa={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Breaks out of an <code>M109</code> or <code>M190</code> wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see <code>M302</code>) and the temperature is too low, this will start "printing" without extrusion. If cold extrusion prevention is disabled and the hot-end temperature is too low, the extruder may jam.<br />
<br />
This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., <code>M112</code>] this requires the host to leave space in the command buffer, or the command won't be executed until later.<br />
<br />
Recent versions of Marlin introduce <code>EMERGENCY_PARSER</code>, which overcomes the buffer limitation by watching the incoming serial stream. Commands M108, M112, M410, and M876 can all be intercepted by the emergency parser, so it is recommended to enable this feature.<br />
<br />
==== M108: Set Extruder Speed (BFB) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sets speed of extruder motor.<br />
(Deprecated in FiveD firmware, see <code>M113</code>)<br />
<br />
==== M109: Set Extruder Temperature and Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> maximum target temperature, waits until cooling (Sprinter)<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and MK4duo)<br />
:<code>Tn</code> tool number (RepRapFirmware and Klipper), optional<br />
;Example<br />
M109 S215<br />
<br />
===== M109 in Teacup =====<br />
<br />
Not needed. To mimic Marlin behaviour, use [[#M104: Set Extruder Temperature | M104]] followed by [[#M116: Wait | M116]].<br />
<br />
===== M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa =====<br />
<br />
Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.<br />
<br />
;Example<br />
M109 S185<br />
<br />
RepRapFirmware also supports the optional <code>T</code> parameter (as generated by slic3r) to specify which tool the command refers to (see below).<br />
<br />
===== M109 in Sprinter (4pi port) =====<br />
<br />
Parameters: <code>S</code> (optional), set target temperature value. If not specified, waits for the temperature set by [[#M104: Set Extruder Temperature | M104]]. <code>R</code> (optional), sets target temperature range maximum value.<br />
<br />
;Example<br />
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.<br />
<br />
If you have multiple extruders, use <code>T</code> or <code>P</code> parameter to specify which extruder you want to set/wait.<br />
<br />
Another way to do this is to use [[#G10: Tool Offset | G10]].<br />
<br />
===== M109 in MakerBot =====<br />
<br />
;Example<br />
M109 S70 T0<br />
<br />
Sets the target temperature for the current build platform. S is the temperature to set the platform to, in degrees Celsius. T is the platform to heat.<br />
<br />
===== M109 in Klipper =====<br />
<br />
According to the [https://www.klipper3d.org/G-Codes.html documentation], Klipper will wait for the specified temperature to settle, i.e. it will wait until it goes back down in case it overshoots. Klipper also supports the optional <code>T</code> parameter to specify which tool the command refers to (see above).<br />
<br />
==== M110: Set Current Line Number ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no|not needed}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Line number<br />
;Example<br />
M110 N123<br />
<br />
This example sets the current line number to 123. Thus the expected next line after this command will be 124.<br />
<br style="clear: both" /><br />
<br />
==== M111: Set Debug Level ====<br />
{{Firmware Support | fived={{yes}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Debug module<sup>1</sup><br />
:<code>Snnn</code> Debug on/off<br />
;Examples<br />
M111 S6<br />
M111 P1 S1<br />
<br />
Enable or disable debugging features in the firmware. The implementation may look different per firmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is only available in RepRapFirmware.<br />
<br />
<sup>2</sup>Prusa fimrware use D-codes/commands for debugging.<br />
<br />
===== M111 in RepRapFirmware =====<br />
<br />
RepRapFirmware allows debugging to be set for each module. If the optional 'P' parameter is not specified, debugging will be enabled for all modules. For a list of modules, send <code>M111 S1 P15</code>.<br />
<br />
===== M111 in Repetier =====<br />
<br />
Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:<br />
<br />
#define DEBUG_ECHO (1<<0)<br />
#define DEBUG_INFO (1<<1)<br />
#define DEBUG_ERRORS (1<<2)<br />
#define DEBUG_DRYRUN (1<<3) // repetier-firmware<br />
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware<br />
<br />
Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)<br />
<br />
For firmware that supports ethernet and web interfaces <code>M111 S9</code> will turn web debug information on without changing any other debug settings, and <code>M111 S8</code> will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.<br />
<br />
==== M112: Full (Emergency) Stop ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M112<br />
<br />
Any moves in progress are immediately terminated, then RepRap shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller. See also <code>M0</code> and <code>M1</code>.<br />
<br />
Please note while many systems termed this an Emergency Stop, this terminology is regulated in many regions with specific requirements behind its use. Marlin 2.0.x has renamed this to Full Stop. RepRapFirmware has indicated an intention to make a similar change as well. This stop function is NOT implemented in a Category 0 or 1 stop fashion or with fail-safe hardware compliying with PLd or better. The function as implemented is a category 2 software stop with no redundancies.<br />
<br />
==== M113: Set Extruder PWM ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M113<br />
<br />
Set the PWM for the currently-selected extruder. On its own this command<br />
sets RepRap to use the on-board potentiometer on the extruder controller board to set the PWM for the currently-selected extruder's stepper power. With an S field:<br />
<br />
M113 S0.7<br />
<br />
it causes the PWM to be set to the <code>S</code> value (70% in this instance). <code>M113 S0</code> turns the extruder off, until an <code>M113</code> command other than <code>M113 S0</code> is sent.<br />
<br />
==== M113: Host Keepalive ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect.<br />
<br />
;Usage<br />
:<code>M113 Snnn</code><br />
;Parameters<br />
:<code>Snnn</code> keepalive interval to set<br />
;Examples<br />
M113 S2<br />
<br />
==== M114: Get Current Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M114<br />
<br />
This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.<br />
<br />
For example, the machine returns a string such as:<br />
<br />
<tt>ok C: X:0.00 Y:0.00 Z:0.00 E:0.00</tt><br />
<br />
In Marlin first 3 numbers is the position for the planner. The other positions are the positions from the stepper function. This helps for debugging a previous stepper function bug.<br />
<br />
<tt>X:0.00 Y:0.00 RZ:0.00 LZ:0.00 Count X:0.00 Y:0.00 RZ:41.02 LZ:41.02</tt><br />
<br />
==== M115: Get Firmware Version and Capabilities ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>2</sup> | repetier={{yes}} | smoothie={{no}} | klipper={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem = {{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Bnnn</code> (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)<br />
:<code>Pnnn</code> Electronics type<sup>1</sup><br />
:<code>V</code> Report the Prusa version number<sup>2</sup><br />
:<code>Unnnnnn</code> Check the firmware version provided<sup>2</sup><br />
;Examples<br />
M115<br />
M115 P2<br />
<br />
Request the Firmware Version and Capabilities of the current microcontroller<br />
The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.<br />
<br />
sample data from firmware:<br />
ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1<br />
<br />
This <code>M115</code> code is inconsistently implemented, and should not be relied upon to exist, or output correctly in all cases. An initial implementation was committed to svn for the FiveD Reprap firmware on 11 Oct 2010. Work to more formally define protocol versions is currently (October 2010) being discussed. See [[M115_Keywords]] for one draft set of keywords and their meanings. See the <code>M408</code> command for a more comprehensive report on machine capabilities supported by RepRapFirmware.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the <code>P</code> parameter is present then the integer argument specifies the hardware being used. The following are currently supported:<br />
<br />
M115 P0 Automatic board type selection if supported, or default if not<br />
M115 P1 Duet 0.6<br />
M115 P2 Duet 0.7<br />
M115 P3 Duet 0.85<br />
<br />
<sup>2</sup>These parameters are only supported in Prusa Firmware. Parameter <code>Unnnnnn</code> will check the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.<br />
<br />
sample data <code>M115</code>:<br />
FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000<br />
<br />
sample data <code>M115 V</code><br />
3.8.1<br />
<br />
sample data on display for 30s or user interaction<code>M115 U3.8.2-RC1</code><br />
New firmware version availible:<br />
3.8.2-RC1<br />
Please upgrade.<br />
<br />
==== M116: Wait ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.<sup>1</sup>''<br />
:<code>Pnnn</code> Tool number<br />
:<code>Hnnn</code> Heater number<br />
:<code>Cnnn</code> Chamber number<br />
;Examples<br />
M116<br />
M116 P1<br />
<br />
Wait for ''all'' temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also <code>M109</code>.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Most implementations don't support any parameters, but RepRapFirmware version 1.04 and later supports an optional 'P' parameter that is used to specify a tool number. If this parameter is present, then the system only waits for temperatures associated with that tool to arrive at their set values. This is useful during tool changes, to wait for the new tool to heat up without necessarily waiting for the old one to cool down fully.<br />
<br />
Recent versions of RepRapFirmware also allow a list of the heaters to be specified using the 'H' parameter, and if the 'C' parameter is present, this will indicate that the chamber heater should be waited for.<br />
<br />
==== M117: Get Zero Position ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}}: See M70 | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117<br />
<br />
This causes the RepRap machine to report the X, Y, Z and E coordinates ''in steps not mm'' to the host that it found when it last hit the zero stops for those axes. That is to say, when you zero X, the <i>x</i> coordinate of the machine when it hits the X endstop is recorded. This value should be 0, of course. But if the machine has drifted (for example by dropping steps) then it won't be. This command allows you to measure and to diagnose such problems. (E is included for completeness. It doesn't normally have an endstop.)<br />
<br />
==== M117: Display Message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M117 Hello World<br />
<br />
This causes the given message to be shown in the status line on an attached LCD. The above command will display Hello World. If RepRapFirmware is used and no LCD is attached, this message will be reported on the web interface.<br />
<br />
;Notes<br />
In Prusa Firmware it is also used to display internal messages on LCD.<sup>1<sup><br />
<br />
==== M118: Echo message on host ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.4+}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | klipper={{yes}} | yaskawa={{no}} }}<br />
<br />
Use this code to print a visible message to the host console, preceded by 'echo:'.<br />
<br />
;Parameters<br />
:<code>Pn</code> (RepRapFirmware only) Message targets(s): 0 = generic [default], 1 = USB, 2 = LCD, 3 = HTTP, 4 = Telnet<br />
:<code>S"msg"</code> (RepRepFirmware only) Message to send<br />
;Example (Marlin)<br />
M118 Color changing to blue<br />
;Example (RepRapFirmware)<br />
M118 P2 S"Color changing to blue"<br />
<br />
==== M118: Negotiate Features ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M118 P42<br />
<br />
This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with <code>M115</code>'s FEATURES keyword.<br />
<br />
See [[Protocol_Feature_Negotiation]] for more info.<br />
<br />
==== M119: Get Endstop Status ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M119<br />
<br />
Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.<br />
<br />
In redeem, <code>M119</code> can also be used to invert end stops.<br />
;Example<br />
M119 X1 1<br />
This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))<br />
<br />
==== M120: Push ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M120<br />
<br />
Push the state of the RepRap machine onto a stack. Exactly what variables get pushed depends on the implementation (as does the depth of the stack - a typical depth might be 5). A sensible minimum, however, might be<br />
<br />
* Current feedrate<br />
* Whether moves are relative or absolute<br />
* Whether extrusion is relative or absolute<br />
<br />
RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:<br />
<br />
* Whether the units are inches or mm<br />
* Whether or not volumetric extrusion is in use<br />
<br />
==== M121: Pop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M121<br />
<br />
Recover the last state pushed onto the stack.<br />
<br />
==== M120: Enable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M121}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M121: Disable endstop detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes|M120}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
==== M122: Firmware dependent ====<br />
<br />
===== M122: Diagnose (RepRapFirmware) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bmmm''' Expansion board number for which diagnostics are requested, default 0 which means main board<br />
:'''Pnnn''' Optional parameter to specify what diagnostics are required. Caution: some values of P will crash the firmware deliberately to test error handling! See the Duet3D wiki for more details.<br />
:'''"DSF"''' Immediate DSF diagnostics (RRF3/Duet3 only with attached SBC)<br />
<br />
;Example<br />
:M122<br />
<br />
Sending an <code>M122</code> causes the RepRap to transmit diagnostic information, for example via a USB serial link.<br />
<br />
If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.<br />
<br />
===== M122: Set Software Endstop (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Disabled or Enabled Software Endstop<br />
M122 S<0/1><br />
<br />
===== M122: Debug L6470 drivers (Marlin) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Get diagnostic info about all L6470 stepper drivers.<br />
<br />
;Example<br />
M122<br />
<br />
==== M123: Firmware dependent ====<br />
<br />
===== M123: Tachometer value (RepRap) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Sending an <code>M123</code> causes the RepRap to transmit filament tachometer values from all extruders.<br />
<br />
===== M123: Endstop Logic (MK4duo) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Logic<br />
:<code>Yn</code> Y Logic<br />
:<code>Zn</code> Z Logic<br />
:<code>In</code> X2 Logic<br />
:<code>Jn</code> Y2 Logic<br />
:<code>Kn</code> Z2 Logic<br />
:<code>Pn</code> Probe Logic<br />
:<code>Dn</code> Door Logic<br />
<br />
;Examples<br />
M123 ; Print Status<br />
M123 X1 Y1 Z0 P0<br />
<br />
==== M124: Firmware dependent ====<br />
<br />
===== M124: Immediate motor stop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Immediately stops all motors.<br />
<br />
===== M124: Set Endstop Pullup =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xn</code> X Pullup on/off<br />
:<code>Yn</code> Y Pullup on/off<br />
:<code>Zn</code> Z Pullup on/off<br />
:<code>In</code> X2 Pullup on/off<br />
:<code>Jn</code> Y2 Pullup on/off<br />
:<code>Kn</code> Z2 Pullup on/off<br />
:<code>Pn</code> Probe Pullup on/off<br />
:<code>Dn</code> Door Pullup on/off<br />
<br />
;Examples<br />
M124 ; Print Status<br />
M124 X1 Y1 Z0 P0<br />
<br />
==== M126: Open Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M126 P500<br />
<br />
Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.<br />
<br />
===== M126 in MakerBot =====<br />
<br />
;Example<br />
M126 T0<br />
<br />
Enables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M127: Close Valve ====<br />
{{Firmware Support | fived={{yes}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M127 P400<br />
<br />
Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.<br />
<br />
===== M127 in MakerBot =====<br />
<br />
;Example<br />
M127 T0<br />
<br />
Disables an extra output attached to a specific toolhead (e.g. fan)<br />
<br />
==== M128: Extruder Pressure PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M128 S255<br />
<br />
PWM value to control internal extruder pressure. <code>S255</code> is full pressure.<br />
<br />
==== M129: Extruder pressure off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M129 P100<br />
<br />
In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.<br />
<br />
==== M130: Set PID P value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> proportional (Kp)<br />
;Example<br />
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0<br />
<br />
Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).<br />
<br />
Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.<br />
<br />
==== M131: Set PID I value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral (Ki)<br />
;Example<br />
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5<br />
<br />
Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.<br />
<br />
==== M132: Set PID D value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no|M301}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{yes|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> derivative (Kd)<br />
;Example<br />
M132 P0 S24 ; Sets heater 0 D factor to 24.0<br />
<br />
Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).<br />
<br />
===== M132 in MakerBot =====<br />
<br />
;Example<br />
M132 X Y Z A B<br />
<br />
Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.<br />
<br />
==== M133: Set PID I limit value ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no|M301}} | prusa={{no|M301}} | reprapfirmware={{no|M301}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no|M301}} | mk4duo={{no}} | yaskawa={{no|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> heater number<br />
:<code>Snnn</code> integral limit (Ki)<br />
;Example<br />
M133 P1 S264 ; Sets heater 1 I limit value to 264<br />
<br />
Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.<br />
<br />
===== M133 in MakerBot =====<br />
<br />
Wait for the toolhead to reach its target temperature.<br />
<br />
;Parameters<br />
:<code>Tnn</code> : Extruder to wait for<br />
:<code>Pnn</code> : Time limit, in seconds<br />
<br />
;Example<br />
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.<br />
<br />
==== M134: Write PID values to EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}}: See M504 | reprapfirmware={{no}}: See M500 | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M134<br />
<br />
===== M134 in MakerBot =====<br />
<br />
;Example<br />
M134 T0 P500<br />
<br />
Instruct the machine to wait for the platform to reach its target temperature. T is the platform to wait for. P if present, sets the time limit.<br />
<br />
==== M135: Set PID sample interval ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Heat sample time in seconds<br />
;Example<br />
M135 S300<br />
<br />
Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.<br />
<br />
===== M135 in MakerBot =====<br />
<br />
;Example<br />
M135 T0<br />
<br />
Instructs the machine to change its toolhead. Also updates the State Machine's current tool_index. T is the toolhead for the machine to switch to and the new tool_index for the state machine to use.<br />
<br />
==== M136: Print PID settings to host ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|M301}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M136 P1 ; print heater 0 PID parameters to host<br />
<br />
==== M140: Set Bed Temperature (Fast) ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Bed heater index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Example<br />
M140 S55<br />
<br />
Set the temperature of the build bed to 55<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the bed).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware. RepRapFirmware allows the bed heater to be switched off if the absolute negative temperature (-273.15) is passed as target temperature. In this case the current bed temperature is not affected:<br />
<br />
M140 S-273.15<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo for Idle temperature<br />
<br />
M140 S60 R30<br />
M140 T1 S60 R30<br />
<br />
There is an optional R field that sets the bed standby temperature:<br />
<code>M140 S65 R40</code>.<br />
<br />
Recent versions of RepRapFirmware also provide an optional 'H' parameter to set the hot bed heater number. If no heated bed is present, a negative value may be specified to disable it.<br />
<br />
==== M141: Set Chamber Temperature (Fast) ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes|1=uses M104}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Chamber index<sup>1</sup><br />
:<code>Hnnn</code> Heater number<sup>1</sup><br />
:<code>Tnnn</code> Tool number<sup>2</sup><br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<sup>1</sup> <sup>2</sup><br />
;Examples<br />
M141 S30<br />
M141 H0<br />
<br />
Set the temperature of the chamber to 30<sup>o</sup>C and return control to the host immediately (''i.e.'' before that temperature has been reached by the chamber).<br />
<br />
; Notes<br />
<br />
<sup>1</sup> These parameters are only supported in RepRapFirmware and work just like in M140.<br />
<br />
<sup>2</sup> These parameters are only supported in MK4duo and work just like in M140.<br />
<br />
==== M142: Firmware dependent ====<br />
<br />
===== M142: Holding Pressure =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M142 S1<br />
<br />
Set the holding pressure of the bed to 1 bar.<br />
<br />
The holding pressure is in bar. For hardware which only has on/off holding, when the holding pressure is zero, turn off holding, when the holding pressure is greater than zero, turn on holding.<br />
<br />
===== M142: Set Cooler Temperature (Fast) =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | redeem={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnnn</code> Tool number<br />
:<code>Snnn</code> Active/Target temperature<br />
:<code>Rnnn</code> Standby temperature<br />
;Examples<br />
M142 S60<br />
M142 S60 R30<br />
M141 T1 S60 R30<br />
<br />
Set the temperature of the cooler<br />
<br />
==== M143: Maximum heater temperature ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>H</code> Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)<br />
:<code>S</code> Maximum temperature<br />
;Examples<br />
M143 S275 ; set the maximum temperature of the hot-end to 275°C<br />
M143 H0 S125 ; set the maximum bed temperature to 125C<br />
<br />
The default maximum temperature for all heaters was 300°C prior to RepRapFirmware version 1.13, and 262°C from 1.13 onwards. From RepRapFirmware 1.17 onwards, the default maximum temperatures are 262C for extruders and 125C for the bed.<br />
<br />
When the temperature of the heater exceeds this value, countermeasures will be taken.<br />
<br />
==== M144: Bed Standby ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn''' Bed heater number, default 0<br />
:'''Sn''' 0 = set bed heater to standby (default), 1 = set bad heater active<br />
;Example<br />
M144<br />
<br />
Switch the bed heater to its standby temperature. <code>M140 S1</code> turns it back to its active temperature.<br />
<br />
==== M146: Set Chamber Humidity ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Relative humidity in percent<br />
;Example<br />
M146 R60<br />
<br />
Set the relative humidity of the chamber to 60% and return control to the host immediately (''i.e.'' before that humidity has been reached by the chamber).<br />
<br />
==== M149: Set temperature units ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>C</code> Flag to treat temperature as degrees Celsius<br />
:<code>K</code> Flag to treat temperature as Kelvin<br />
;Example<br />
M149 K<br />
<br />
It affects the <code>S</code> or <code>R</code> values in the codes <code>M104</code>, <code>M109</code>, <code>M140</code>, <code>M141</code>, <code>M143</code>, <code>M190</code> and <code>G10.</code> The default is <code>M149 C</code>.<br />
<br />
==== M150: Set LED color ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|See below}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Red component<br />
:<code>Unnn</code> Green component<br />
:<code>Bnnn</code> Blue component<br />
:<code>Wnnn</code> White component (Marlin)<br />
:<code>Pnnn</code> Brightness (0-255) (Marlin, also RepRapFirmware 2.03 and later)<br />
:<code>P</code> Set full brightness (Marlin)<br />
:<code>Snnn</code> (RepRapFirmware) Number of individual LEDs to set to these colours<br />
:<code>Fn</code> (RepRapFirmware) Following command action. F0 (default) means this is the last command for the LED strip, so the next M150 command starts at the beginning of the strip. F1 means further M150 commands for the remainder of the strip follow this one.<br />
:<code>Xn</code> (RepRapFirmware) LED type: X0 (default) = DotStar, X1 = NeoPixel. This parameter is remembered from one call to the next, so it only needs to be given once.<br />
:<code>Ynn</code> (RepRapFirmware) Brightness, 0-31 (alternative to P 0-255)<br />
:<code>Qnnn</code> (RepRapFirmware) Use specified SPI frequency (in Hz) instead of default frequency. This parameter is only processed if X parameter also present. When using NeoPixels, only frequencies between about 2.5MHz and 4MHz will work.<br />
;Example<br />
M150 R255 U128 B192<br />
;Example (RepRapFirmware)<br />
M150 X1 F3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz<br />
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow<br />
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming LED strip<br />
<br />
Set BlinkM, Neopixel, and/or other LED light color and intensity with RGBW component values from 0 to 255. Some LCD controllers use this interface for a backlight. Firmware may override the set color to indicate the current printer status.<br />
<br />
RepRapFirmware uses this command to control DotStar or NeoPixel LED strips on controllers that provide a connector for this purpose. When using NeoPixel strips there is a firmware-dependent maximum number of LEDs in the strip supported determined by the size of the DMA buffer.<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M155: Automatically send temperatures ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> enable sending temperatures = 1, disable = 0<br />
;Example<br />
M155 S1<br />
<br />
Hosts normally monitor printer temperatures by sending <code>M105</code> every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. <code>M155</code> addresses these problems by telling the firmware to automatically report temperatures at regular intervals. This behavior is disabled by default for best compatibility with existing hosts. If the firmware supports <code>M155</code> the output of <code>M115</code> will report the <code>AUTOREPORT_TEMP</code> capability:<br />
<br />
Cap:AUTOREPORT_TEMP:1<br />
<br />
==== M160: Number of mixed materials ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M160 S4<br />
<br />
This command has been superseded by the tool definition command <code>M563</code> (see below).<br />
<br />
Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.<br />
<br />
When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:<br />
<br />
M160 S4<br />
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89<br />
G1 X70.6 E0:0:0:42.4<br />
G1 E42.4:0:0:0<br />
<br />
The second line moves straight to the point (90.6, 13.8) extruding a total of 22.4mm of filament. The mix ratio for the move is 0.1:0.1:0.1:0.7.<br />
<br />
The third line moves back 20mm in X extruding 42.4mm of filament.<br />
<br />
The fourth line has no physical effect.<br />
<br />
==== M163: Set weight of mixed material ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> extruder number<br />
:<code>Pnnn</code> weight<br />
<br />
Set weight for this mixing extruder drive.<br/><br />
<small>See ''[[Repetier Color Mixing]]'' for more informations.</small><br />
<br />
==== M164: Store weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> virtual extruder number<br />
:<code>Pnnn</code> store to eeprom (P0 = no, P1 = yes)<br />
<br />
Store weights as virtual extruder S.<br />
<br />
==== M165: Set multiple mix weights ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}}: | smoothie={{no}} | reprapfirmware={{partial|M567}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters <code>A B C D H I</code><br />
:<code>A[factor]</code> Mix factor for extruder stepper 1<br />
:<code>B[factor]</code> Mix factor for extruder stepper 2<br />
:<code>C[factor]</code> Mix factor for extruder stepper 3<br />
:<code>D[factor]</code> Mix factor for extruder stepper 4<br />
:<code>H[factor]</code> Mix factor for extruder stepper 5<br />
:<code>I[factor]</code> Mix factor for extruder stepper 6<br />
<br />
* Set multiple mix factors for a mixing extruder.<br />
* Factors that are left out will be set to 0.<br />
* All factors together must add up to 1.0.<br />
<br />
==== M190: Wait for bed temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|M116}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin and Prusa)<br />
;Example<br />
M190 S60<br />
<br />
Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.<br />
<br />
==== M191: Wait for chamber temperature to reach target temp ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M191 S60<br />
<br />
Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.<br />
<br />
;Parameters<br />
:<code>Snnn</code> minimum target temperature, waits until heating<br />
:<code>Rnnn</code> accurate target temperature, waits until heating and cooling (Marlin)<br />
<br />
==== M200: Set filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
'''RepRapFirmware:'''<br />
<br />
;Parameters<br />
:'''Daaa:bbb:ccc...''' Sets filament diameter to aaa for extruder 0, bbb for extruder 1 and so on. If any of aaa, bbb etc. are zero then volumetric extrusion is disabled for that extruder.<br />
:'''Daaa''' Sets filament diameter (or disables volumetric extrusion) for all extruders<br />
;Examples<br />
:M200 D0 ; disable volumetric extrusion on all extruders<br />
:M200 D1.75 ; set al extruder filament diameters to 1.75mm<br />
:M200 D1.75:3.0:1.75 ; set extruder 0 to 1.75mm, extruder 1 to 3.0mm and all remaining extruders to 1.75mm<br />
<br />
Volumetric extrusion is an option you can set in some slicers whereby all extrusion amounts are specified in mm<sup>3</sup> (cubic millimetres) of filament instead of mm of filament. This makes the gcode independent of the filament diameter, potentially allowing the same gcode to run on different printers. The purpose of the M200 command is to inform the firmware that the gcode input files have been sliced for volumetric extrusion, and to provide the filament diameter so that the firmware can adjust the requested extrusion amount accordingly.<br />
<br />
Sending M200 without parameters reports the current volumetric extrusion state and (where appropriate) filament diameter for each extruder.<br />
<br />
Note that if you use slicer-commanded retraction, the retraction amounts must be specified in mm<sup>3</sup> too. If instead you use firmware retraction, then the firmware retraction amounts specified using the M207 command are still interpreted as mm.<br />
<br />
'''Other firmwares:'''<br />
<br />
Without parameters loads default grid, and with specified extension attempts to load the specified grid. If not available will not modify the current grid.<br />
If Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
<code>M200 Dm.mmm</code> sets the filament diameter to m.mmm millimeters. It is used with 'volumetric calibration' and G-code generated for an ideal 1.128mm diameter filament, which has a volume of 1mm^3 per millimeter. The intention is to be able to generate filament-independent g-code. (See [[Triffid_Hunter's_Calibration_Guide#Optional:_Switch_to_volumetric_E_units]] and http://wooden-mendel.blogspot.com/2011/09/volumetric-stage-two.html for more information.)<br />
<br />
<code>M200 D0</code> or <code>M200 D1.128</code> ; reset E multiplier to 1, since sqrt(1 / pi) * 2 = 1.128<br />
<br />
See also [[Gcode#M119:_Get_Endstop_Status]]<br />
<br />
Question: what does a firmware do with filament diameter? Has this an effect on how much an E command moves the extruder motor? --[[User:Traumflug|Traumflug]] 11:34, 14 October 2012 (UTC) Yes, Marlin uses this to set a 'volumetric_multiplier' by which the E-steps of a move are scaled in the planner. [[User:DaveX|DaveX]] ([[User talk:DaveX|talk]]) 16:44, 12 April 2014 (PDT)<br />
Smoothie implements the same thing as Marlin --[[User:Arthurwolf|Arthurwolf]] ([[User talk:Arthurwolf|talk]]) 05:23, 10 November 2014 (PST)<br />
<br />
==== M201: Set max acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Acceleration for X axis<br />
:<code>Ynnn</code> Acceleration for Y axis<br />
:<code>Znnn</code> Acceleration for Z axis<br />
:<code>Ennn</code> Acceleration for extruder drives<br />
;Example<br />
M201 X1000 Y1000 Z100 E2000<br />
<br />
Sets the acceleration that axes can do in units/second^2 for print moves. For consistency with the rest of G Code movement this should be in units/(minute^2), but that gives really silly numbers and one can get lost in all the zeros. So for this we use seconds.<br />
<br />
RepRapFirmware expects these values to be in mm/s².<br />
<br />
The M201 command is intended to be used to define the machine limits. Slicers should not generate these commands, they should use the M204 command to define the accelerations requested for a particular job.<br />
<br />
==== M202: Set max travel acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set max travel acceleration in units/s^2 for travel moves (<code>M202 X1000 Y1000</code>). ''Unused in Marlin!!''<br />
<br />
==== M203: Set maximum feedrate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum feedrate for X axis<br />
:<code>Ynnn</code> Maximum feedrate for Y axis<br />
:<code>Znnn</code> Maximum feedrate for Z axis<br />
:<code>Ennn</code> Maximum feedrate for extruder drives<br />
:<code>Innn</code> (RepRapFirmware) Minimum feed rate (optional) <br />
;Example<br />
M203 X6000 Y6000 Z300 E10000<br />
<br />
Sets the maximum feedrates that your machine can do in mm/min. (Marlin uses mm/sec).<br />
<br />
This command is intended to define the machine limits. Slicers should not generate M203 commands, instead they should use the F parameter on G0, G1 etc. command to specify the requested speeds. <br />
<br />
===== M203 (Repetier): Set temperature monitor =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set temperature monitor to <code>Sx</code>. Repetier Firmware only.<br />
<br />
==== M204: Set default acceleration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.18+}} | klipper={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFimware)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Tnnn</code> Acceleration for travel moves<br />
;Example<br />
M204 P500 T2000<br />
<br />
Use <code>M201</code> to set per-axis accelerations and extruder accelerations. RepRapFirmware applies the <code>M204</code> accelerations to the move as a whole, and also applies the limits set by <code>M201</code> to each axis and extruder.<br />
<br />
;Parameters (MK4duo)<br />
:<code>Pnnn</code> Acceleration for printing moves<br />
:<code>Vnnn</code> Acceleration for travel moves<br />
:<code>Rnnn</code> Acceleration for Retraction for Tools with T code<br />
;Example<br />
M204 P500 V2000 T0 R5000<br />
<br />
'''Other firmwares:'''<br />
<br />
S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2 also sets minimum segment time in ms (B20000) to prevent buffer underruns and <code>M20</code> minimum feedrate<br />
<br />
'''Marlin notes:''' After Mar11-2015, the <code>M204</code> options have changed in Marlin:<br />
<br />
P = Printing moves<br />
<br />
R = Retract only (no X, Y, Z) moves<br />
<br />
T = Travel (non printing) moves<br />
<br />
The command <code>M204 P800 T3000 R9000</code> sets the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.<br />
<br />
===== M204 Repetier =====<br />
<br />
;Usage<br />
:<code>M204 X[Kp] Y[Ki] Z[Kd]</code><br />
<br />
Set PID parameter. Values are 100*real value.<br />
<br />
==== M205: Advanced settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{partial|M566}} | klipper={{no}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Sprinter / Marlin:<br />
:Minimum travel speed = <code>S[printing]</code> <code>T[travel]</code><br />
:<code>B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]</code><br />
<br />
;Sprinter / Marlin Example:<br />
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s<br />
<br />
'''Smoothieware''' uses a different algorithm: [https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/]<br />
:X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].<br />
:Z junction deviation only applies to z only moves<br />
:0 disables junction deviation for Z<br />
:-1 uses global junction deviation<br />
<br />
;Smoothie example:<br />
M205 X0.05 ; set X/Y Junction Deviation<br />
<br />
===== M205: EEPROM Report =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | klipper={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Output EEPROM settings. Repetier Firmware only.<br />
<br />
==== M206: Offset axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis offset<br />
:<code>Ynnn</code> Y axis offset<br />
:<code>Znnn</code> Z axis offset<br />
;Example<br />
M206 X10.0 Y10.0 Z-0.4<br />
<br />
The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a <code>G92</code> right after homing (<code>G28</code>, <code>G161</code>).<br />
<br />
With Marlin firmware, this value can be saved to EEPROM using the <code>M500</code> command.<br />
<br />
A similar command is <code>G10</code>, aligning these two is [[Talk:G-code#M104 .26 M109 Deprecation, G10 Introduction | subject to discussion]].<br />
<br />
With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.<br />
<br />
In builds of RepRapFirmware that support CNC workplace coordinates, using this command is equivalent to using G10 L2 P1 to set the coordinate offsets for workplace 1.<br />
<br />
===== M206: Set EEPROM value =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a Repetier Firmware EEPROM value.<br />
<br />
;Parameters<br />
:<code>T[type]</code> Value type<br />
:<code>P[pos]</code> Value position<br />
:<code>[S(long)]</code> An integer value<br />
:<code>[X(float)]</code> A float value<br />
<br />
;Example<br />
M206 T3 P39 X19.9 ; Set Jerk to 19.9<br />
<br />
==== M207: Firmware dependent ====<br />
<br />
===== M207: Set retract length =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length to retract, in mm<br />
:<code>Rnnn</code> positive or negative additional length to un-retract, in mm (RepRapFirmware only)<br />
:<code>Fnnn</code> retraction feedrate, in mm/min<br />
:<code>Tnnn</code> feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)<br />
:<code>Znnn</code> additional zlift/hop<br />
;Example<br />
M207 S4.0 F2400 Z0.075<br />
<br />
Set the retract length used by the <code>G10</code> and <code>G11</code> commands. Units are in mm regardless of <code>M200</code> setting.<br />
<br />
Machinekit uses different parameters and speed units for <code>M207</code>. Use <code>P</code> to set retract length in mm. Use <code>Q</code> to set retract velocity in mm/s. For firmware retraction Machinekit uses <code>G22</code> and <code>G23</code> in place of <code>G10</code> and <code>G11</code>.<br />
<br />
===== M207: Calibrate Z axis with Z max endstop =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use G1 S3 ...}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M207<br />
<br />
After placing the tip of the nozzle in the position you expect to be considered Z=0, issue this command to calibrate the Z axis. It will perform a z axis homing routine and calculate the distance traveled in this process. The result is stored in EEPROM as z_max_length. For using this calibration method the machine must be using a Z MAX endstop.<br />
<br />
This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.<br />
<br />
===== M207: Set jerk without saving to EEPROM =====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{partial|M566}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.<br />
<br />
Since Repetier 0.91 December 2013 [//github.com/repetier/Repetier-Firmware/blob/d86da831853288d4a10fb0584d006c7763ca2bb6/src/ArduinoAVR/Repetier/Repetier.ino#102] (if not earlier)<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Temporarily set XY jerk in mm/s<br />
:<code>Znnn</code> Temporarily set Z jerk in mm/s<br />
:<code>Ennn</code> Temporarily set Extruder jerk in mm/s<br />
<br />
;Example<br />
M207 X10 ; Change the X/Y Jerk to 10mm/s<br />
<br />
==== M208: Set axis max travel ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> 0 = set axis maximum (default), 1 = set axis minimum<br />
:<code>Xnnn</code> X axis limit<br />
:<code>Ynnn</code> Y axis limit<br />
:<code>Znnn</code> Z axis limit<br />
;Example<br />
:M208 X200 Y200 Z90 ; set axis maxima<br />
:M208 X-5 Y0 Z0 S1 ; set axis minima<br />
<br />
The values specified set the software limits for axis travel in the specified direction. The axis limits you set are also the positions assumed when an endstop is triggered.<br />
<br />
==== M208: Set unretract length ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M207}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> positive length surplus to the <code>M207 Snnn</code>, in mm<br />
:<code>Fnnn</code> feedrate, in mm/sec<br />
<br />
Sets recover=unretract length.<br />
<br />
==== M209: Enable automatic retract ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M209 S1<br />
<br />
This boolean value S 1=true or 0=false enables automatic retract detect if the slicer did not support <code>G10</code>/<code>G11</code>: every normal extrude-only move will be classified as retract depending on the direction.<br />
<br />
==== M210: Set homing feedrates ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M210 X1000 Y1500<br />
<br />
Set the feedrates used for homing to the values specified in mm per minute.<br />
<br />
==== M211: Disable/Enable software endstops ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M564}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The boolean value S 1=enable or 0=disable controls state of software endstop.<br />
<br />
The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.<br />
<br />
;Example<br />
M211 X1 Y1 Z1 S0<br />
<br />
Disables X,Y,Z max endstops<br />
<br />
;Example<br />
M211 X0 S1<br />
<br />
Enables X min endstop<br />
<br />
;Example<br />
M211<br />
<br />
Prints current state of software endstops.<br />
<br />
==== M212: Set Bed Level Sensor Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}}* | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use G31}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This G-Code command is known to be available in the newer versions of PrintrBot's branch of Marlin. It may not be available in other firmware.<br />
<br />
;Example<br />
M212 Z-0.2<br />
<br />
Set the Z home to 0.2 mm lower than where the sensor says Z home is. This is extremely useful when working with printers with hard-to-move sensors, like the PrintrBot Metal Plus.<br />
<br />
PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes <code>M500</code> & <code>M501</code> after setting this.<br />
<br />
==== M217: Toolchange Parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use tool change files}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
If arguments are given, sets tool-change retract and prime length (mm), prime feedrate (mm/m), retract feedrate (mm/m), and park position/raise (mm) or Z raise (mm): S<length> P<prime_speed> R<retract_speed> X<xpos> Y<ypos> Z<zraise>. XY arguments require '''SINGLENOZZLE_SWAP_PARK'''. If no arguments are given, reports current values. Currently used to set the <code>SINGLENOZZLE</code> tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.<br />
<br />
==== M218: Set Hotend Offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Use G10}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.<br />
<br />
;Example<br />
M218 T1 X50 Y0.5<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is only active if <code>EXTRUDERS</code> is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.<sup>1</sup><br />
<br />
==== M220: Set speed factor override percentage ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Speed factor override percentage (0..100 or higher)<br />
;Example<br />
M220 S80<br />
<br />
Sets the speed factor override percentage.<br />
<br />
==== M221: Set extrude factor override percentage ====<br />
{{Firmware Support | fived={{no}} | teacup={{yes}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Extrude factor override percentage (0..100 or higher), default 100%<br />
:<code>Dnnn</code> Extruder drive number (RepRapFirmware only), default 0<br />
:<code>Tnnn</code> Extruder drive number (Prusa Firmware only), default 0 if not set.<sup>1</sup><br />
;Example<br />
M221 S70<br />
M221 S95 D1<br />
M221 S85 T1<br />
<br />
Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.<br />
<br />
==== M220: Turn off AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M221: Turn on AUX V1.0.5 ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M222: Set speed of fast XY moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M223: Set speed of fast Z moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M224: Enable extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M225: Disable on extruder during fast moves ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{yes}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M226: G-code Initiated Pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{yes}} | machinekit={{yes}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M226<br />
<br />
Initiates a synchronous pause (pauses after all previous commands from the same stream have been completed). That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of <code>M1</code> in the [http://www.nist.gov/manuscript-publication-search.cfm?pub_id=823374 NIST RS274NGC G-code standard] and <code>M0</code> in Marlin firmware.<br />
<br />
==== M226: Wait for pin state ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{no|see M577}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> pin number<br />
:<code>Snnn</code> pin state<br />
;Example<br />
M226 P2 S1<br />
<br />
Wait for a pin to be in some state.<br />
<br />
==== M227: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M227 P1600 S1600<br />
<br />
P and S are steps.<br />
<br />
"Reverse and Prime" means, the extruder filament is retracted some distance when not in use and pushed forward the same amount before going into use again. This shall help to prevent drooling of the extruder nozzle. Teacup firmware implements this with <code>M101</code>/<code>M103</code>.<br />
<br />
==== M228: Disable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M228<br />
<br />
See also <code>M227</code>.<br />
<br />
==== M229: Enable Automatic Reverse and Prime ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M229 P1.0 S1.0<br />
<br />
<code>P</code> and <code>S</code> are extruder screw rotations. See also <code>M227</code>.<br />
<br />
==== M230: Disable / Enable Wait for Temperature Change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M230 S1<br />
<br />
<code>S1</code> Disable wait for temperature change<br />
<code>S0</code> Enable wait for temperature change<br />
<br />
==== M231: Set OPS parameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]<br />
<br />
==== M232: Read and reset max. advance values ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
==== M240: Trigger camera ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
Triggers a camera to take a photograph. (Add to your per-layer G-code.)<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M240: Start conveyor belt motor / Echo off ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo off}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M240<br />
<br />
The conveyor belt allows to start mass production of a part with a reprap.<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M241: Stop conveyor belt motor / echo on ====<br />
{{Firmware Support | fived={{no}} | teacup={{experimental|Debug: Echo on}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M241<br />
<br />
Echoing may be controlled in some firmwares with <code>M111</code>.<br />
<br />
==== M245: Start cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M245<br />
<br />
used to cool parts/heated-bed down after printing for easy remove of the parts after print<br />
<br />
==== M246: Stop cooler ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M246<br />
<br />
==== M250: Set LCD contrast ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M250 C20<br />
<br />
Sets LCD contrast C<contrast value> (value 0..63), if available.<br />
<br />
==== M251: Measure Z steps from homing stop (Delta printers) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M251 S0 ; Reset<br />
M251 S1 ; Print<br />
M251 S2 ; Store to Z length (also EEPROM if enabled)<br />
<br />
(This is a Repetier-Firmware only feature.)<br />
<br />
==== M260: i2c Send Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Buffer and send data over the i2c bus. Use <code>A</code> to set the address from 0-127. Add up to 32 bytes to the buffer with each <code>B</code>. Send and reset the buffer with <code>S</code>.<br />
<br />
;Parameters (Marlin, MK4duo)<br />
:'''Ann''' I2C address<br />
:'''Bnn''' Byte to buffer or send<br />
:'''S''' If present, sends the bytes that have been buffered<br />
;Examples<br />
M260 A5 B65 S ; Send 'A' to Address 5 now<br />
M260 A0 ; Set address to 0 (broadcast)<br />
M260 B77 ; M<br />
M260 B97 ; a<br />
M260 B114 ; r<br />
M260 B108 ; l<br />
M260 B105 ; i<br />
M260 B110 ; n<br />
M260 S1 ; Send the current buffer<br />
;Parameters (RepRapFirmware)<br />
:'''Ann''' I2C address<br />
:'''Bnn:nn:nn...''' Bytes to send<br />
:'''Snn''' Number of bytes to receive (optional, RepRapFirmware 2.02 and later)<br />
;Examples<br />
M260 A5 B65 ; Send 'A' to address 5<br />
M260 A"0x7F" B65 ; Send 'A' to address 7F (hex)<br />
M260 A0 B82:101:112:82:97:112 ; Send 'RepRap' to address 0<br />
<br />
RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.<br />
<br />
==== M261: i2c Request Data ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Request data from an i2c slave device. This command simply relays the received data to the host.<br />
<br />
;Parameters<br />
:'''Ann''' I2C address<br />
:'''Bnn''' How many bytes to request<br />
;Example<br />
M261 A99 B5 ; Request 5 bytes from Address 99<br />
<br />
Both <code>M260</code> and <code>M261</code> are commands demonstrating use of the i2c bus (TWIBus class) in Marlin Firmware. Developers and vendors can make Marlin an i2c master device by enabling <code>EXPERIMENTAL_I2CBUS</code>, and Marlin can act as a slave device by setting <code>I2C_SLAVE_ADDRESS</code> from 8-127. This class can be used to divide up processing responsibilities between multiple instances of Marlin running on multiple boards. For example, one board might control a Z axis with 4 independent steppers to create a self-leveling system, or a second board could drive the graphical display while the first board handles printing.<br />
<br />
==== M280: Set servo position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{partial|Use M340}} | reprapfirmware={{yes|1.16+}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set servo position absolute.<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Servo index<br />
:<code>Snnn</code> Angle or microseconds<br />
:<code>I1</code> Invert polarity (RepRapFirmware only)<br />
;Example<br />
M280 P1 S50<br />
<br />
Marlin and RepRapFirmware treat <code>S</code> values below 200 as angles, and 200 or greater as the pulse width in microseconds.<br />
<br />
In RepRapFirmware, the servo index is the same as the pin number for the <code>M42</code> command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.<br />
<br />
RepRapFirmware supports the optional I1 parameter, which if present causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The <code>I</code> parameter is not remembered between <code>M280</code> commands (unlike the <code>I</code> parameter in <code>M106</code> commands), so if you need inverted polarity then you must include I1 in every <code>M280</code> command you send.<br />
<br />
{| class="wikitable" style="text-align: center;"<br />
|+ Duet 0.8.5 M280 P value to Expansion Port Pin Mapping <br />
! style="width: 50px;" | P<br />
! Name<br />
! style="width: 50px;" | Expansion Port Pin<br />
|-<br />
| colspan="3" | Use M307 H# A-1 C-1 D-1 before using these pins<br />
|-<br />
|3||PC23_PWML6||21<br />
|-<br />
|4||PC22_PWML5||22<br />
|-<br />
|5||PC21_PWML4||23<br />
|}<br />
<br />
On the Duet 0.6, pin 18 is controlled by heater 2. On the 0.8.5, pin 18 is controlled by heater 6, but is also shared with fan1. In order to use this pin, the fan must be disabled (<code>M106 P1 I-1</code>). See [https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins Using servos and controlling unused I/O pins]<br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M290: Babystepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.7+}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters (RepRapFirmware)<br />
:<code>Snnn</code> Amount to baby step Z in mm. Positive values raise the head, negative values lower it.<br />
:<code>Xnnn, Ynnn, ...</code> Amount to baby step other axes in mm (optional, supported in later RepRapFirmware versions)<br />
:<code>Znnn</code> Synonym for S (RepRapFirmware 1.21 and later)<br />
:<code>Rn</code> (Optional, RepRapFirmware 1.21 and later) R1 = relative (add to any existing babystep amount, the default), R0 = absolute (set babystepping offset to the specified amount)<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
M290 R0 S0 ; clear babystepping (RepRapFirmware 1.21 and later only)<br />
<br />
;Parameters (Repetier)<br />
:<code>Znnn</code> Amount to baby step in mm. Positive values raise the head, negative values lower it.<br />
;Examples<br />
M290 S0.05 ; babystep the head up 0.05mm<br />
<br />
;Additional Parameters (Marlin 1.1.7 and later)<br />
:<code>Xnnn</code> Amount to babystep X in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Ynnn</code> Amount to babystep Y in current units. (Requires <code>BABYSTEP_XY</code>)<br />
:<code>Znnn</code> Amount to babystep Z in current units. Synonym for '<code>S</code>' parameter.<br />
;Example<br />
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm<br />
<br />
This command tells the printer to move the axis (or axes) transparently to the motion system. This is like physically moving the axes by force, but much nicer to the machine.<br />
<br />
In RepRapFirmware <code>M290</code> with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.<br />
<br />
In RepRapFirmware 1.19 and earlier, the babystepping offset is reset to zero when the printer is homed or the bed is probed. In RepRapFirmware 1.21 and later, homing and bed probing don't reset babystepping, but you can reset it explicitly using M290 R0 S0.<br />
<br />
Note: If the <code>BABYSTEP_ZPROBE_OFFSET</code> option is used in Marlin, this command also affects the Z probe offset (as set by <code>M851</code>) and that offset ''will'' be saved to EEPROM.<br />
<br />
==== M291: Display message and optionally wait for response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"message"</code> The message to display, which must be enclosed in double quotation marks. If the message itself contains a double quotation mark, use two double quotation marks to represent it.<br />
:<code>R"message"</code> Optional title for the message box. Must be enclosed in double quotation marks too.<br />
:<code>Sn</code> Message box mode (defaults to 1)<br />
:<code>Tn</code> Timeout in seconds, only legal for S=0 and S=1. The message will be cancelled after this amount of time, if the user does not cancel it before then. A zero or negative value means that the message does not time out (it may still be cancelled by the user if it has a Close button). In RepRapFirmware, the default timeout for messages that do not require acknowledgement is 10 seconds.<br />
:<code>Zn</code> 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head<br />
;Examples<br />
M291 P"Please do something and press OK when done" S2<br />
M291 P"This message will be closed after 10 seconds" T10<br />
<br />
This command provides a more flexible alternative to M117, in particular messages that time out, messages that suspend execution until the user acknowledges them, and messages that allow the user to adjust the height of the print head before acknowledging them.<br />
<br />
Allowed message box modes include:<br />
<br />
0. No buttons are displayed (non-blocking)<br />
1. Only "Close" is displayed (non-blocking)<br />
2. Only "OK" is displayed (blocking, send M292 to resume the execution)<br />
3. "OK" and "Cancel" are displayed (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)<br />
<br />
The combination S0 T0 is not permitted, because that would generate a message box with no close button and that never times out, which would lock up the user interface.<br />
<br />
Duet Web Control 2.0.3 and later supports HTML in the message body.<br />
<br />
==== M292: Acknowledge message ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
; Parameters<br />
: <code>Pn</code> Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)<br />
<br />
This command is sent by the user interface when the user acknowledges a message that was displayed because of a M291 command with parameter S=2 or S=3.<br />
<br />
==== M300: Play beep sound ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{yes}} | klipper={{partial|Needs macro}}<sup>2</sup> | bfb={{no}} | machinekit={{yes}} | makerbot={{yes}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> frequency in Hz<br />
:<code>Pnnn</code> duration in milliseconds<br />
;Example<br />
M300 S300 P1000<br />
<br />
Play beep sound, use to notify important events like the end of printing. [http://www.3dprinting-r2c2.com/?q=content/seasons-greetings See working example on] [[R2C2_RepRap_Electronics|R2C2 electronics]].<br />
<br />
If an LCD device is attached to RepRapFirmware, a sound is played via the add-on touch screen control panel. Else the web interface will play a beep sound.<br />
<br />
;Notes<br />
<sup>1</sup>In Prusa Firmware the defaults are 100Hz and 1000ms, so that <code>M300</code> without parameters will beep for a second.<br />
<br />
<sup>2</sup>Klipper does not support <code>M300</code> by default, however it can be easily added as a [https://github.com/KevinOConnor/klipper/blob/master/config/sample-macros.cfg G-code macro]<br />
<br />
==== M301: Set PID parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|See M130-M133}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware= {{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> heater number (Smoothie uses 'S', Redeem uses 'E')<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware<br />
M301 S0 P30 I10 D10 ; Smoothie<br />
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)<br />
<br />
Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also [[PID Tuning]].<br />
<br />
===== MK4duo =====<br />
<br />
H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER<br />
<br />
===== Marlin =====<br />
<br />
Hot end only; see <code>M304</code> for bed PID. H is the heater number, default 1 (i.e. first extruder heater).<br />
<br />
===== RepRapFirmware 1.15 onwards =====<br />
<br />
In RepRapFirmware 1.15 and later the M301 is supported as described above, but it is not normally used. Instead the heater model is defined by M307 or found by auto tuning, and the firmware calculates the PID parameters from the model. An M301 command can be used in config.g after the M307 command for that heater to override the firmware-computed PID parameters.<br />
<br />
===== RepRapFirmware 1.09 to 1.14 inclusive =====<br />
* <code>H</code> Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.<br />
* <code>P</code> Interprets a negative P term as indicating that bang-bang control should be used instead of PID (not recommended for the hot end, but OK for the bed heater).<br />
* <code>I</code> Integral value<br />
* <code>D</code> Derivative value<br />
* <code>T</code> Is the approximate additional PWM (on a scale of 0 to 255) needed to maintain temperature, per degree C above room temperature. Used to preset the I-accumulator when switching from heater fully on/off to PID.<br />
* <code>S</code> PWM scaling factor, to allow for variation in heater power and supply voltage. Is designed to allow a correction to be made for a change in heater power and/or power supply voltage without having to change all the other parameters. For example, an S factor of 0.8 means that the final output of the PID controller should be scaled to 0.8 times the standard value, which would compensate for a heater that is 25% more powerful than the standard one or a supply voltage that is 12.5% higher than standard.<br />
* <code>W</code> Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.<br />
* <code>B</code> PID Band. Errors larger than this cause heater to be on or off.<br />
<br />
An example using all of these would be:<br />
M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30<br />
<br />
===== Smoothie =====<br />
<br />
<code>S0</code> is 0 for the hotend, and 1 for the bed, other numbers may apply to your configuration, depending on the order in which you declare temperature control modules.<br />
<br />
===== Other implementations =====<br />
<br />
W: Wind-up. Sets the maximum value of I-term, so it does not overwhelm other PID values, and the heater stays on. (Check firmware support - Sprinter, Marlin?)<br />
<br />
;Example<br />
M301 W125<br />
<br />
===== Teacup =====<br />
<br />
See <code>M130</code>, <code>M131</code>, <code>M132</code>, <code>M133</code> for [[Teacup]]'s codes for setting the PID parameters.<br />
<br />
==== M302: Allow cold extrudes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes|0.92+}} | smoothie={{no}} | reprapfirmware= {{yes}}<sup>1</sup> | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)<br />
:<code>Pnnn</code> Cold extrude allow state (RepRapFirmware)<br />
:<code>Rnnn</code> Cold retraction minimum temperature (RepRapFirmware 2.02 and later)<br />
<br />
;Examples (RepRapFirmwre)<br />
M302 ; Report current state<br />
M302 P1 ; Allow cold extrusion<br />
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C<br />
<br />
;Examples (Others)<br />
M302 S0 ; Allow extrusion at any temperature<br />
M302 S170 ; Allow extrusion above 170<br />
<br />
This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>RepRapFirmware uses the <code>P[0|1]</code> parameter instead of <code>S[temperature]</code>, and for <code>M302</code> with no parameters it will report the current cold extrusion state.<br />
<br />
==== M303: Run PID tuning ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
[[PID Tuning]] refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed (E-1). Send the appropriate code and wait for the output to update the firmware.<br />
<br />
Hot end usage:<br />
M303 S<temperature> C<cycles><br />
Bed usage (repetier, not sure whether cycles work here):<br />
M303 P1 S<temperature><br />
Bed usage (others):<br />
M303 E-1 C<cycles> S<temperature><br />
;Example<br />
M303 C8 S175<br />
Smoothie's syntax, where <code>E0</code> is the first temperature control module (usually the hot end) and <code>E1</code> is the second temperature control module (usually the bed):<br />
M303 E0 S190<br />
In RepRapFirmware, this command computes the process model parameters (see <code>M307</code>), which are in turn used to calculate the PID constants. H is the heater number, P is the PWM to use (default 0.5), and S is the maximum allowable temperature (default 225). Tuning is performed asynchronously. Run <code>M303</code> with no parameters to see the current tuning state or the last tuning result.<br />
<br />
;Example<br />
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C<br />
<br />
;Notes<br />
<br />
In Marlin Firmware you can add the <code>U1</code> parameter to apply the PID results to current settings upon completion.<br />
<br />
==== M304: Set PID parameters - Bed ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | smoothie={{no|M301}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes|M301}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> proportional (Kp)<br />
:<code>Innn</code> integral (Ki)<br />
:<code>Dnnn</code> derivative (Kd)<br />
;Examples<br />
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3<br />
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware<br />
M304 ; Report parameters<br />
<br />
Sets Proportional, Integral and Derivative values for bed. RepRapFirmware interprets a negative P term as indicating that bang-bang control should be used instead of PID. In RepRapFirmware, this command is identical to <code>M301</code> except that the <code>H</code> parameter (heater number) defaults to zero.<br />
<br />
See also [[PID Tuning]].<br />
<br />
===== M304 in RepRapPro version of Marlin: Set thermistor values =====<br />
<br />
In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) <code>M304</code> is used to set thermistor values (as <code>M305</code> is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. <code>M304</code> Sets the parameters for temperature measurement.<br />
<br />
;Example<br />
M304 H1 B4200 R4800 T100000<br />
<br />
This tells the firmware that for heater 1 (<code>H</code> parameter: 0 = heated bed, H = first extruder), the thermistor beta (<code>B</code> parameter) is 4200, the thermistor series resistance (<code>R</code> parameter) is 4.8Kohms, the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms. All parameters other than H are optional. If only the <code>H</code> parameter is given, the currently-used values are displayed. They are also displayed within the response to <code>M503</code>.<br />
<br />
==== M305: Set thermistor and ADC parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number, or virtual heater number<br />
:<code>S"name"</code> Heater name (optional, RepRapFirmware only)<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>T"c"</code> (for MAX31856-based thermocouple sensors) The thermistor type letter, default K<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0<br />
:<code>Hnnn</code> ADC high offset correction, default 0<br />
:<code>Xnnn</code> Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the <code>P</code> parameter<br />
:<code>Fnn </code> (where nn is 50 or 60) If the sensor interface uses a MAX31856 thermocouple chip or MAX31865 PT100 chip, this is the local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Example<br />
M305 P1 T100000 R1000 B4200<br />
<br />
Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (<code>P</code> parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (<code>T</code> parameter) is 100Kohms, the thermistor series resistance (<code>R</code> parameter) is 1Kohms, the thermistor beta (<code>B</code> parameter) is 4200. All parameters other than P are optional. If only the <code>P</code> parameter is given, the existing values are displayed.<br />
<br />
;Example<br />
M305 P1 T100000 R1000 B4200 H14 L-11 X2<br />
<br />
The H correction affects the reading at high ADC input voltages, so it has the greatest effect at low temperatures. The L correction affects the reading at low input voltages, which correspond to high temperatures.<br />
<br />
The <code>X</code> parameter tells the firmware to use the thermistor input corresponding to a different heating channel. RepRapFirmware also allow an external SPI thermocouple interface (such as the MAX31855) or PT100 interface (MAX31865) to be configured. MAX31855 thermocouple channels are numbered from 100, MAX31856 thermocouple channels are numbered from 150, PT100 channels from 200 and current loop channels from 300. Channel 1000 is the CPU temperature indication, 1001 is the temperature of the hottest stepper motor driver on the main board, and 1001 is the temperature of the hottest drivers on the expansion board.<br />
<br />
In the above example, the ADC high end correction (<code>H</code> parameter) is 14, the ADC low end correction (<code>L</code> parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.<br />
<br />
==== M306: Set home offset calculated from toolhead position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M306 Z0<br />
<br />
The values specified are added to the calculated end stop position when the axes are referenced. The calculated value is derived from the distance of the toolhead from the current axis zero point.<br />
<br />
The user would typically place the toolhead at the zero point of the axis and issue the <code>M306</code> command.<br />
<br />
This value can be saved to EEPROM using the <code>M500</code> command (as <code>M206</code> value).<br />
<br />
Implemented in Smoothieware<br />
<br />
==== M307: Set or report heating process parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.15+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hn</code> Heater number (0 is usually the bed heater)<br />
:<code>Annn</code> gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.<br />
:<code>Cnnn</code> dominant time Constant of the heating process in seconds<br />
:<code>Dnnn</code> Dead time in seconds<br />
;Four optional additional parameters help control the heating process:<br />
:<code>Fnnn</code> PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).<br />
:<code>Bn</code> selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for bed and chamber heaters.<br />
:<code>Snnn</code> maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.<br />
:<code>Vnnn</code> VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero (the default) disables compensation for changes in supply voltage.<br />
;Examples<br />
M307 H0 ; report the process parameters for heater 0<br />
M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8 ; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%<br />
<br />
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters, using different values for the heating or cooling phase and the steady state phase. It is also used to better detect heater faults. In future it may be used to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see <code>M303</code>.<br />
<br />
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the <code>A</code>, <code>C</code>, and <code>D</code> parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command. In RepRapFirmware 3, M950 should be used to free up the pin instead.<br />
<br />
==== M308: Set or report sensor parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Common Parameters<br />
:<code>Sn</code> Sensor number<br />
:<code>P"pin_name"</code> The name of the control board pin that this sensor uses. For thermistors it is the thermistor input pin name. For sensors connected to the SPI bus it is the name of the output pin used as the chip select.<br />
:<code>Y"sensor_type"</code> The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"<br />
:<code>A"name"</code> Sensor name (optional), displayed in the web interface<br />
;Additional parameters for thermistors<br />
:<code>Tnnn</code> (for thermistor sensors) Thermistor resistance at 25<sup>o</sup>C<br />
:<code>Bnnn</code> Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient<br />
:<code>Cnnn</code> Steinhart-Hart C coefficient, default 0<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for PT1000 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Lnnn</code> ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
:<code>Hnnn</code> ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)<br />
;Additional parameters for MAX31856-based thermocouple sensors<br />
:<code>T"c"</code> The thermistor type letter, default K<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for MAX31865-based PT100 sensors<br />
:<code>Rnnn</code> Series resistor value<br />
:<code>Fnn </code> (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.<br />
;Additional parameters for linear analog sensors<br />
:<code>Fn</code> F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)<br />
:<code>Lnnn</code> The temperature or other value when the ADC output is zero<br />
:<code>Hnnn</code> The temperature or other value when the ADC output is full scale<br />
<br />
This code replaces M305 in RepRapFirmware 3. In earlier versions of RepRapFirmware, sensors only existed in combination with heaters, which necessitated the concept of a "virtual heater" to represent a sensor with no associated heater (e.g. MCU temperature sensor). RepRapFirmware 3 allows sensors to be defined independently of heaters. The association between heaters and sensors is defined using M950.<br />
<br />
M308 can be used in the following ways:<br />
<br />
M308 Snn Y"type" P"pin" [other parameters] ; delete sensor nn if it exists, create a new one with default settings, and configure it using the other parameters<br />
M308 Snn ; report the settings of sensor nn<br />
M308 A"name" ; report the settings of the first sensor named "name"<br />
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn<br />
<br />
Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.<br />
<br />
==== M320: Activate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M320</code><br />
:<code>M320 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, activate and store persistently in EEPROM<br />
;Examples<br />
M320 ; temporarily activate auto leveling<br />
M320 S1 ; permanently activate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M321: Deactivate autolevel (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M321</code><br />
:<code>M321 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, deactivate and store persistently in EEPROM<br />
;Examples<br />
M321 ; temporarily deactivate auto leveling<br />
M321 S1 ; permanently deactivate auto leveling<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M322: Reset autolevel matrix (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M322</code><br />
:<code>M322 S1</code><br />
;Parameters<br />
:<code>Snnn</code> if greater than 0, also reset the matrix values saved EEPROM<br />
;Examples<br />
M322 ; temporarily reset auto level matrix<br />
M322 S1 ; permanently reset auto level matrix<br />
<br />
Parameter <code>Snnn</code> is optional.<br />
<br />
(Repetier only)<br />
<br />
==== M323: Distortion correction on/off (Repetier) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M323</code><br />
:<code>M323 Snnn</code><br />
:<code>M323 Snnn Pnnn</code><br />
;Parameters<br />
:<code>Snnn</code> 0 (disable correction) or 1 (enable correction)<br />
:<code>Pnnn</code> 1 (store correction state persistently in EEPROM)<br />
;Examples<br />
M323 ; Show if distortion correction is enabled<br />
M323 S0 ; Disable distortion correction temporarily<br />
M323 S1 P1 ; Enable distortion correction permanently<br />
<br />
(Repetier only)<br />
Controls distortion correction feature after having set it up using <code>G33.</code><br />
<br />
==== M340: Control the servos ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
(Repetier only ,Marlin see [[Gcode#M280:_Set_servo_position|M280]])<br />
<br />
M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500<br />
<br />
Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.<br />
<br />
==== M350: Set microstepping mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets microstepping mode.<br />
<br />
Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.<br />
<br />
;Usage<br />
:<code>M350 Snn Xnn Ynn Znn Enn Bnn</code><br />
;Parameters<br />
:''Not all parameters need to be used, but at least '''one''' should be used. As with other commands, RepRapFirmware reports the current settings if no parameters are used''.<br />
:<code>Snn</code> Set stepping mode for all drivers (not supported by RepRapFirmware)<br />
:<code>Xnn</code> Set stepping mode for the X axis<br />
:<code>Ynn</code> Set stepping mode for the Y axis<br />
:<code>Znn</code> Set stepping mode for the Z axis<br />
:<code>Enn</code> Set stepping mode for Extruder 0 (for RepRapFirmware use <code>Enn:nn:nn</code> etc. for multiple extruders)<br />
:<code>Bnn</code> Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)<br />
:<code>Inn</code> Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)<br />
;Modes (nn)<br />
:1 = full step<br />
:2 = half step<br />
:4 = quarter step<br />
:8 = 1/8 step<br />
:16 = 1/16 step<br />
:64 = 1/64 step<br />
:128 = 1/128 step<br />
:256 = 1/256 step<br />
;Examples<br />
M350 S16 ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware<br />
M350 Z1 ; set the Z-axis' driver to use full steps<br />
M350 E4 B4 ; set both extruders to use quarter steps - Marlin/Repetier<br />
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware<br />
<br />
==== M351: Toggle MS1 MS2 pins directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M351<br />
<br />
==== M355: Turn case lights on/off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use M106}} | sprinter={{no}} | marlin={{yes|1.1.0+}} | prusa={{no}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M355 S1 ; Enable lights<br />
M355 S0 ; Disable lights<br />
M355 ; Report status<br />
<br />
Every call or change over LCD menu sends a state change for connected hosting software like:<br />
Case lights on<br />
Case lights off<br />
No case lights<br />
<br />
==== M360: Report firmware configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M503}} | prusa={{no|M503}} | repetier={{yes|0.92.2+}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Target<br />
This command helps hosting software to detect configuration details, which the user would need to enter otherwise.<br />
It should reduce configuration time considerably if supported.<br />
<br />
;Example<br />
M360<br />
<br />
;Response:<br />
<pre><br />
Config:Baudrate:250000<br />
Config:InputBuffer:127<br />
Config:NumExtruder:2<br />
Config:MixingExtruder:0<br />
Config:HeatedBed:0<br />
Config:SDCard:1<br />
Config:Fan:1<br />
Config:LCD:1<br />
Config:SoftwarePowerSwitch:1<br />
Config:XHomeDir:-1<br />
Config:YHomeDir:-1<br />
Config:ZHomeDir:-1<br />
Config:SupportG10G11:1<br />
Config:SupportLocalFilamentchange:1<br />
Config:CaseLights:0<br />
Config:ZProbe:1<br />
Config:Autolevel:0<br />
Config:EEPROM:1<br />
Config:PrintlineCache:24<br />
Config:JerkXY:30.00<br />
Config:JerkZ:0.30<br />
Config:RetractionLength:3.00<br />
Config:RetractionLongLength:13.00<br />
Config:RetractionSpeed:40.00<br />
Config:RetractionZLift:0.00<br />
Config:RetractionUndoExtraLength:0.00<br />
Config:RetractionUndoExtraLongLength:0.00<br />
Config:RetractionUndoSpeed:0.00<br />
Config:XMin:0.00<br />
Config:YMin:0.00<br />
Config:ZMin:0.00<br />
Config:XMax:250.00<br />
Config:YMax:150.00<br />
Config:ZMax:90.00<br />
Config:XSize:250.00<br />
Config:YSize:150.00<br />
Config:ZSize:90.00<br />
Config:XPrintAccel:250.00<br />
Config:YPrintAccel:250.00<br />
Config:ZPrintAccel:100.00<br />
Config:XTravelAccel:250.00<br />
Config:YTravelAccel:250.00<br />
Config:ZTravelAccel:100.00<br />
Config:PrinterType:Cartesian<br />
Config:MaxBedTemp:120<br />
Config:Extr.1:Jerk:50.00<br />
Config:Extr.1:MaxSpeed:100.00<br />
Config:Extr.1:Acceleration:10000.00<br />
Config:Extr.1:Diameter:0.00<br />
Config:Extr.1:MaxTemp:220<br />
Config:Extr.2:Jerk:50.00<br />
Config:Extr.2:MaxSpeed:100.00<br />
Config:Extr.2:Acceleration:10000.00<br />
Config:Extr.2:Diameter:0.00<br />
Config:Extr.2:MaxTemp:220<br />
</pre><br />
<br />
==== SCARA calibration codes (Morgan) ====<br />
<br />
In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{partial}} }}<br />
<br />
==== M360: Move to Theta 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
The arms move into a position where the Theta steering arm is parallel to the top platform edge. The user then calibrates the position by moving the arms with the jog buttons in software like pronterface until it is perfectly parallel. Using <code>M114</code> will then display the calibration offset that can then be programmed into the unit using <code>M206</code> (Home offset) X represents Theta.<br />
<br />
Smoothieware: <code>M360 P0</code> will take the current position as parallel to the platform edge, and store the offset in the homing trim offset (M666) No further user interaction is needed.<br />
<br />
==== M361: Move to Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Theta move to 90 degrees with platform edge. User calibrates by using jog arms to place exactly 90 degrees. Steps per degree can then be read out by using <code>M114</code>, and programmed using <code>M92</code>. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat <code>M360</code> after adjusting steps per degree.<br />
<br />
Smoothieware: <code>M360 P0</code> will accept the current position as 90deg to platform edge. New steps per angle is calculated and entered into memory (M92) No further user interaction is required, except to redo <code>M360</code>.<br />
<br />
==== M362: Move to Psi 0 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 0 degree. Check only after other Theta calibrations<br />
<br />
==== M363: Move to Psi 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Arms move to Psi 90 degree. Check only after other Theta calibrations<br />
<br />
==== M364: Move to Psi + Theta 90 degree position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Move arms to form a 90 degree angle between the inner and outer Psi arms. Calibrate by moving until angle is exactly 90 degree. Read out with <code>M114</code>, and calibrate value into Home offset <code>M206</code>. Psi is represented by Y.<br />
<br />
Smoothieware: <code>M364 P0</code> will accept the current position as 90deg between arms. The offset is stored as a trim offset (M666) and no further user interaction is required except to save all changes via <code>M500</code>.<br />
<br />
==== M365: SCARA scaling factor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|Use M579}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{experimental}} }}<br />
<br />
Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1<br />
<br />
==== M366: SCARA convert trim ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Executing this command translates the calculated trim values of the SCARA calibration to real home offsets. This prevents the home and trim movement after calibration.<br />
<br />
==== M370: Morgan manual bed level - clear map ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{partial|Use M557}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Clear the map and prepare for calibration<br />
;Usage<br />
:<code>M370</code><br />
:<code>M370 X[divisions] Y[divisions]</code><br />
<br />
Without parameters is defaults to <code>X5 Y5</code> (25 calibration points)<br />
When specifying parameters, uneven numbers are recommended.<br />
<br />
==== M371: Move to next calibration position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Move to the next position for calibration. User moves the bed towards the hotend until it just touches<br />
<br />
==== M372: Record calibration value, and move to next position ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed<br />
<br />
==== M373: End bed level calibration mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
End calibration mode and enable z correction matrix. Does not save current matrix<br />
<br />
==== M374: Save calibration grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Saves the calibration grid.<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only) Extension of the grid file<br />
:<code>P"filename"</code> (RepRapFirmware only) Name of the file to save to<br />
:<code>Z</code> (Smoothieware only) Also save the <code>M206</code> Z homing offset into the grid file<br />
;Usage (Smoothieware)<br />
M374<br />
M374 <file extension> Z<br />
;Usage (RepRapFirmware)<br />
M374<br />
M374 P"MyAlternateHeightMap.csv"<br />
<br />
In Smoothieware, without parameters this saves the grid into the default grid file that gets loaded at boot. The optional parameter specifies the extension of the grid file - useful for special grid files such as for a special print surface like a removable print plate. Addition of Z will additionally save the <code>M206 Z</code> homing offset into the grid file.<br />
<br />
In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file <code>heightmap.csv</code> if no filename was specified. To load the height map automatically at startup, use command <code>M375</code> in the config.g file.<br />
<br />
==== M375: Display matrix / Load Matrix ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)<br />
;Parameters<br />
:<code>extension</code> (Smoothieware only)<br />
:<code>P"filename"</code> (RepRapFirmware only)<br />
;Usage<br />
M375<br />
M375 [file extension] ; (Smoothieware only)<br />
M375 P"MyAlternateHeightMap.csv" ; (RepRapFirmware only)<br />
<br />
Without parameters loads default grid, and with specified extension or specified filename attempts to load the specified grid. If not available will not modify the current grid.<br />
In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.<br />
<br />
==== M376: Set bed compensation taper ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M420Z}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes|1.17+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> Height (mm) over which to taper off the bed compensation<br />
;Example<br />
M376 H10<br />
<br />
This command specifies that bed compensation should be tapered off over the specified height, so that no bed compensation is applied at and above that height. If H is zero or negative then no tapering is applied, so compensation is performed throughout the entire print.<br />
<br />
If the firmware does not adjust the extrusion amount to compensate for the changing layer height while tapering is being applied, you will get under- or over-extrusion. Using a large taper height will reduce this effect. For example, if the taper height is 50 times the largest bed height error, then under- or over-extrusion will be limited to 2%.<br />
<br />
==== M380: Activate solenoid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M380<br />
<br />
Activates solenoid on active extruder.<br />
<br />
==== M381: Disable all solenoids ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M381<br />
<br />
==== M400: Wait for current moves to finish ====<br />
{{Firmware Support | fived={{no}} | teacup={{no|use G4}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | klipper={{yes}} | smoothie={{yes}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M400<br />
<br />
Finishes all current moves and and thus clears the buffer. That's identical to <code>G4 P0</code> for Teacup printers.<br />
<br />
==== M401: Lower z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M401<br />
M401 P1<br />
<br />
Lower z-probe if present. In RepRapFirmware this runs macro file '''sys/deployprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/deployprobe.g''' if it exists.<br />
<br />
==== M402: Raise z-probe ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''P''' (RepRapFirmware only) Probe number, default 0 <br />
;Example<br />
M402<br />
M402 P1<br />
<br />
Raise z-probe if present. In RepRapFirmware this runs macro file '''sys/retractprobe#.g''' (where # is the probe number) if it exists, otherwise '''sys/retractprobe.g''' if it exists.<br />
<br />
==== M403: Set filament type (material) for particular extruder and notify the MMU ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>E</code> Extruder number<br />
:<code>F</code> Filament type<br />
<br />
Currently three different materials are needed (default, flex and PVA).<br />
<br />
And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.<br />
<br />
==== M404: Filament width and nozzle diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Nnnn</code> Filament width (in mm)<br />
:<code>Dnnn</code> Nozzle diameter (in mm)<sup>1</sup><br />
;Examples<br />
M404 N1.75<br />
M404 N3.0 D1.0<br />
<br />
Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>While Marlin only accepts the 'N' parameter, RepRapFirmware further allows to specify the nozzle diameter (in mm) via the 'D 'parameter. This value is used to properly detect the first layer height when files are parsed or a new print is being started.<br />
<br />
==== M405: Filament Sensor on ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M405<br />
<br />
Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.<br />
<br />
==== M406: Filament Sensor off ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M591}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M406<br />
<br />
Turn off Filament Sensor extrusion control.<br />
<br />
==== M407: Display filament diameter ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M407<br />
<br />
Displays measured filament diameter. In RepRapFirmware, <code>M407</code> does the same as <code>M404</code>.<br />
<br />
==== M408: Report JSON-style response ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Response type<br />
:<code>Rnnn</code> Response sequence number<br />
;Example<br />
M408 S0<br />
<br />
Report a JSON-style response by specifying the desired type using the 'S' parameter. The following response types are supported:<br />
<br />
* Type 0 is a short-form response, similar to the response used by older versions of the web interface.<br />
* Type 1 is like type 0 except that static values are also included.<br />
* Type 2 is similar to the response provided by the web server for Duet Web Control.<br />
* Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.<br />
* Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.<br />
* Type 5 reports the current machine configuration.<br />
<br />
Here is an example of a typical type 0 response:<br />
<br />
{"status":"I","heaters":[25.0,29.0,28.3],"active":[-273.1,0.0,0.0],"standby":[-273.1,0.0,0.0],"hstat":[0,2,1],"pos":[-11.00,0.00,0.00],"extr":[0.0,0.0],<br />
"sfactor":100.00, "efactor":[100.00,100.00],"tool":1,"probe":"535","fanPercent":[75.0,0.0],"fanRPM":0,"homed":[0,0,0],"fraction_printed":0.572}<br />
<br />
The response is set as a single line with a newline character at the end. The meaning of the fields is:<br />
<br />
status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update<br />
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)<br />
active: active temperatures of the heaters<br />
standby: standby temperatures of the heaters<br />
hstat: status of the heaters, 0=off, 1=standby, 2=active, 3=heater fault. Heater 0 is normally the bed heater, heaters 1, 2.. are the extruder heaters.<br />
pos: the X, Y and Z (and U, V, W if present) axis positions of the current tool (if a tool is selected), or of the print head reference point if no tool is selected<br />
extr: the positions of the extruders<br />
sfactor: the current speed factor (see <code>M220</code> command)<br />
efactor: the current extrusion factors (see <code>M221</code> command), one value per extruder<br />
tool: the selected tool number. A negative number typically means no tool selected.<br />
probe: the Z-probe reading<br />
fanPercent: the speeds of the controllable fans, in percent of maximum<br />
fanRPM: the print cooling fan RPM<br />
homed: the homed status of the X, Y and Z axes (and U, V, W if they exist), or towers on a delta. 0=axis has not been homed so position is not reliable, 1=axis has been homed so position is reliable.<br />
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.<br />
message: the message to be displayed on the screen (only present if there is a message to display)<br />
timesLeft: an array of the estimated remaining print times (in seconds) calculated by different methods. These are currently based on the proportion of the file read,<br />
the proportion of the total filament consumed, and the proportion of the total layers already printed. Only present if a print from SD card is in progress.<br />
seq: the sequence number of the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater than that.<br />
resp: the most recent non-trivial G-code response or error message. Only present if the <code>R</code> parameter was provided and the current sequence number is greater.<br />
<br />
The type 1 response comprises these fields plus some additional ones that do not generally change and therefore do not need to be fetched as often. The extra fields include:<br />
<br />
myName: the name of the printer<br />
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"<br />
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.<br />
axes: the number of axes<br />
volumes: the number of SD card slots available<br />
numTools: the number of available tools numbered contiguously starting from 0<br />
<br />
The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.<br />
<br />
For a more detailed comparison of type 2 - 5, see [[RepRap_Firmware_Status_responses]].<br />
<br />
PanelDue currently uses only <code>M408 S0</code> and <code>M408 S1</code>.<br />
<br />
==== M409: Query object model ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.01 and later}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>K"key"</code> Key string, default empty<br />
:<code>F"flags"</code> Flags string, default empty<br />
;Examples<br />
M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes<br />
M409 K"move.axes[0] F"v" ; report all properties of the first axis, including values not normally reported<br />
M409 K"move.axes[].homed" ; for all axes, report whether it is homed<br />
M409 K"#move.axes" ; report the number of axes<br />
M408 F"f" ; report all values that are likely to have changed recently<br />
M409 F"v" ; report the entire object model (caution, this may be very large!)<br />
<br />
The key string is just the path to the Object Model (OM) variables wanted, with the following extensions:<br />
* An element that is an array may be followed by either [''number''] to select just one element, or by [] to select all elements and report the results as an array<br />
* The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned<br />
<br />
An empty key string selects the entire object model.<br />
<br />
The flags string may include one or more of the following:<br />
<br />
d#: (depth) return the OM to depth d# where # is a sequence of digits. The default depth is 1 if the key is empty or not provided (because the returned object would be very large, perhaps too large to send), otherwise a large value (larger than the maximum depth of anything in the OM).<br />
f: (frequent) return only those values in the object model that typically change frequently during a job. User interfaces can use M409 with this flag to stay up to date.<br />
n: (null) include fields with null values (null fields are normally omitted, but null array elements are never omitted) <br />
v: (verbose) include values that are rarely needed and not normally returned (e.g. controller electronics and firmware limits)<br />
<br />
The response is a JSON object of the following form:<br />
<br />
{"key":"''key''","flag'":"''flags''","result":''object-value''}<br />
<br />
The key and flags fields are as provided in the M409 command. If the key string is malformed or refers to a property that does not exist in the object model, the result field is '''null'''.<br />
<br />
RepRapFirmware on network-enabled electronics also provides the same functionality via the rr_model call to the HTTP API.<br />
<br />
==== M410: Quick-Stop ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0-RC2+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M112}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command does a quick stop of all stepper motors and aborts all moves in the planner. This command is only intended for emergency situations, and due to the instant stop the actual stepper positions may be shifted. Note that if `EMERGENCY_PARSER` is disabled, the response may be delayed while the command buffer is being queued. If a print job is in progress, it will continue, so it is important to suspend the print job before using this command.<br />
<br />
==== M412: Disable Filament Runout Detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M591}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable filament runout detection. When filament sensors are enabled, the firmware responds to a filament runout by running the configured G-code (usually <code>M600</code> Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.<br />
<br />
Usage: <code>M412 S[on|off]</code><br />
<br />
If no 'S' parameter if given, this command reports the current state of filament runout detection.<br />
<br />
;Examples<br />
:<code>M412 S1</code> ''Enable filament runout detection''<br />
:<code>M412 S0</code> ''Disable filament runout detection''<br />
:<code>M412</code> ''Report the current filament runout detection state''<br />
<br />
==== M413: Power-Loss Recovery ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use M911}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Enable or disable the '''Power-loss Recovery''' feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.<br />
<br />
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)<br />
<br />
Usage: <code>M413 S[on|off]</code><br />
<br />
If no 'S' parameter if given, this command reports the current state of Power-loss Recovery.<br />
<br />
;Examples<br />
:<code>M413 S1</code> ''Enable power-loss recovery''<br />
:<code>M413 S0</code> ''Disable power-loss recovery''<br />
:<code>M413</code> ''Report the current power-loss recovery state''<br />
<br />
==== M415: Host Rescue ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
The host rescue G-code is essential to enabling host software to recover from a lost connection or power loss. With this solution the firmware stores the last received coordinate and current position in EEPROM. Once the host reconnects, the firmware reports this recovery information. From the last-received coordinate the host can determine the last line that was processed. Firmware should move the extruder to a parking position if commands stop arriving during an active print job (with heaters still on). Once the host starts sending new commands the firmware should restore the last position. Host and firmware developers can work together to optimize this solution.<br />
<br />
If the firmware supports this solution it should announce it with the capability:<br />
<code>Cap:HOST_RESCUE:1</code><br />
<br />
;Examples<br />
;<code>M415 S1</code> ''Enable host rescue system''<br />
;<code>M415 S0</code> ''Disable host rescue system''<br />
;<code>M415 Z[zpos]</code> ''Set Z position as if homed''<br />
;<code>M415</code> ''Report rescue state''<br />
<br />
Every call to M415 reports the state. Answers are<br />
<br />
RESCUE_STATE: OFF<br />
<br />
Nothing stored. Print finished.<br />
<br />
RESCUE_STATE: LX:121.97 LY:143.33 LZ:3.30 LE:1.84 LT:0 X:0.00 Y:240.00 Z:13.30 E:1.84<br />
<br />
Print was interrupted. Coordinates with leading L are last received positions, LT is active extruder. Normal coordinates are current position and can be omitted, if the move did not finish due to power loss.<br />
<br />
On a power loss the firmware should respond with <code>POWERLOSS_DETECTED</code> as early as possible to give host time to flush log as it is likely host will also go down very soon.<br />
<br />
Support is available in Repetier-Firmware 1.0.4 or higher. Repetier-Server 0.91.0 is the first to use this concept and can be used to validate implementation.<br />
<br />
==== M416: Power loss ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Host tells firmware that it will loose power. This is the solution in case a connected host has a power loss detection and firmware does not. Firmware should return<br />
the message <code>POWERLOSS_DETECTED</code> and do whatever firmware is supposed to do in that case. In combination with host rescue it should store positions, disable heaters, go to park position.<br />
<br />
==== M420: Set RGB Colors as PWM (MachineKit) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Usage: <code>M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]</code><br />
<br />
;Example<br />
M420 R255 E255 B255<br />
<br />
Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the <code>E</code> value instead of the G value due to the G code being a primary code that cannot be overridden.<br />
<br />
In Marlin <code>M420</code> is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable<br />
<br />
==== M420: Leveling On/Off/Fade (Marlin) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{yes|Use G29 and M376}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Enable/Disable Bed Leveling (using the current stored grid or mesh).<br />
<br />
;Usage<br />
:<code>M420 S[bool] Z[float]</code><br />
<br />
;Examples<br />
M420 S1 ; Enable compensation using current grid/mesh<br />
M420 Z10 ; Gradually reduce compensation until Z=10<br />
<br />
Marlin 1.1.0 adds the <code>Z</code> parameter to set the "fade" height. This requires the <code>ENABLE_LEVELING_FADE_HEIGHT</code> option.<br />
<br />
When the <code>Z</code> fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.<br />
<br />
==== M421: Set a Mesh Bed Leveling Z coordinate ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires <code>MESH_BED_LEVELING</code> or <code>AUTO_BED_LEVELING_BILINEAR</code> or <code>AUTO_BED_LEVELING_UBL</code>.<br />
<br />
I & J are the index for the X and Y axis respectively.<br />
<br />
;Usage<br />
:<code>M421 I[index] J[index] Z[float]</code> to set an absolute value to a mesh point<br />
or<br />
:<code>M421 I[index] J[index] Q[float]</code> to offset a mesh point by a specified value<br />
<br />
==== M425: Backlash Correction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.x+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware= {{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Fnnn</code> Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)<br />
:<code>Snnn</code> Distance over which backlash correction is spread<sup>1</sup> (mm)<br />
:<code>Xnnn</code> Set the backlash distance on X (mm; 0 to disable)<br />
:<code>Ynnn</code> Set the backlash distance on Y (mm; 0 to disable)<br />
:<code>Znnn</code> Set the backlash distance on Z (mm; 0 to disable)<br />
:<code>X</code> Use measured value for backlash on X (if available)<br />
:<code>Y</code> Use measured value for backlash on Y (if available)<br />
:<code>Z</code> Use measured value for backlash on Z (if available)<br />
<br />
;Examples (Marlin)<br />
M425 ; Report current state<br />
M425 Z ; Use measured value of backlash on Z<br />
M425 F1 S3 ; Full backlash compensation while smoothing over 3mm.<br />
M425 F0.5 S0.0 ; Compensate for 50% of the backlash with no smoothing<br />
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis<br />
<br />
;Notes<br />
<sup>1</sup> In Marlin, backlash compensation works by adding extra steps to one or more<br />
segments after a motor direction reversal. With smoothing off, this can cause<br />
blemishes on the print. Enabling smoothing will cause those extra steps to<br />
be spread over multiple segments, minimizing artifacts.<br />
<br />
==== M450: Report Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M450</code><br />
<br />
;Example<br />
> M450<br />
> PrinterMode:FFF<br />
<br />
Printers can be used for different task by exchanging the toolhead. Depending on the<br />
tool, a different behavior of some commands can be expected. This command reports<br />
the current working mode. Possible answers are:<br />
<br />
:PrinterMode:FFF<br />
:PrinterMode:Laser<br />
:PrinterMode:CNC<br />
<br />
==== M451: Select FFF Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M451</code><br />
<br />
;Example<br />
> M451<br />
> PrinterMode:FFF<br />
<br />
Switches to FFF mode for filament printing.<br />
<br />
==== M452: Select Laser Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M452</code><br />
<br />
;Example<br />
> M452<br />
> PrinterMode:Laser<br />
<br />
Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during <code>G1</code> moves if laser was enabled or E is increasing. <code>G0</code> moves should never enable the laser. <code>M3</code>/<code>M5</code> can be used to enable/disable the laser for moves.<br />
<br />
==== M453: Select CNC Printer Mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M453</code><br />
<br />
;Parameters (RepRapFirmware only)<br />
* '''Snnn''' (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max<br />
* '''Pfff:rrr''' Logical pin numbers used to drive the spindle motor in clockwise and counterclockwise directions. Omit the ":rrr" part if the spindle turns clockwise only.<br />
* '''I'''n Invert (I1) or don't invert (I0, default) the output polarity<br />
* '''Rnnn''' Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.<br />
* '''Fnnn''' (optional) The PWM frequency to use<br />
* '''Tnnn''' (optional) Assign spindle to a tool allowing better control in DWC<br />
<br />
;Example<br />
> M453<br />
> PrinterMode:CNC<br />
<br />
Switches to CNC mode. In this mode <code>M3</code>/<code>M4</code>/<code>M5</code> control the pins defined for the milling device.<br />
<br />
Notes for RepRapFirmware: By default, no output is assigned to the spindle motor. Logical pin numbers for the P parameters are as defined for the M42 and M208 commands. If you wish to assign a heater or fan output to control the spindle motor as in the above example, you must first disable the corresponding heater (see M307) or fan (see M106).<br />
<br />
==== M460: Define temperature range for thermistor-controlled fan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{yes|Use M106}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Usage<br />
:<code>M460 X[minTemp] Y[maxTemp]</code><br />
<br />
;Example<br />
M460 X50 Y60<br />
<br />
If the firmware has a thermistor controlled fan defined, you can set at which temperature the fan starts and from which temperature on it should run with maximum speed.<br />
<br />
==== M470: Create Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>P"name"</code> Name of directory to create<br />
<br />
;Usage<br />
:<code>M470 P"directory/to/create"</code><br />
<br />
;Example<br />
M470 P"/sys/config.d"<br />
<br />
This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.<br />
<br />
==== M471: Rename File/Directory on SD-Card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S"name"</code> Name of existing file/directory<br />
:<code>T"name"</code> New name of file/directory<br />
:<code>Dnnn</code> Setting this to 1 will delete an existing file that matches the T parameter value<br />
<br />
;Usage<br />
:<code>M471 S"source/name" T"dest/name" D1</code><br />
<br />
;Example<br />
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"<br />
<br />
Rename or move a file or directory. Using the D parameter can delete a file with the target name.<br />
Renaming or moving across directories is possible though not from one SD-Card to another.<br />
<br />
==== M486: Cancel Object ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.01 and later}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} | makerbot={{no}} | grbl={{no}} }}<br />
<br />
The <code>M486</code> G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use <code>M486 T</code> to tell the firmware how many objects there are, so it can provide an LCD interface. (Otherwise the firmware counts them up in the first layer.) In every layer of your G-code, you must preface each object's layer slice with <code>M486 S[index]</code> to indicate which object is being printed. The index should be zero-based. To cancel the first object, use <code>M486 P0</code>; to cancel the 5th object use <code>M486 P4</code>; and so on. The "current" object is canceled with <code>M486 C</code>.<br />
<br />
G-codes associated with the canceled objects are no longer printed. Firmware supports this feature by ignoring G0-G3/G5 moves in XYZ while updating F and keeping the E coordinate up-to-date without extruding.<br />
<br />
Slicers should number purge towers and other global features with a negative index (or other flag) to distinguish them from regular print objects, since it is important to preserve color changes, purge towers, and brims.<br />
<br />
Host software (such as OctoPrint) may be able to cancel individual objects through a plugin, and in this case they should not use M486 P to cancel objects (although doing so should cause no harm).<br />
<br />
;Usage<br />
M486 T12 ; Total of 12 objects (otherwise the firmware must count)<br />
M486 S3 ; Indicate that the 4th object is starting now<br />
M486 S3 A"cube copy 3" ; Indicate that the 4th object is starting now and name it (RepRapFirmware)<br />
M486 S-1 ; Indicate a non-object, purge tower, or other global feature<br />
M486 P10 ; Cancel object with index 10 (the 11th object)<br />
M486 U2 ; Un-cancel object with index 2 (the 3rd object)<br />
M486 C ; Cancel the current object (use with care!)<br />
M486 ; List the objects on the build plate (RepRapFirmware)<br />
<br />
;M486 implementation in RepRapFirmware:<br />
:If the GCode file being printed contains object label comments (e.g. using the "Label objects" option in PrusaSlicer) then it is not necessary to use M486 S commands to indicate which object is being printed. Objects on the build plate will be numbered from 0 in the order in which their labels first appear in the file.<br />
:If you do use M486 S commands in the GCode file instead of object label comments, then RepRapFirmware provides an optional A parameter to the M486 S command to allow objects to be named. The name of each object need only be specified once.<br />
:M486 without parameters lists the names and approximate locations of known objects on the build plate. For the benefit of user interfaces, this information may also be retrieved from the object model using M409.<br />
<br />
==== M500: Store parameters in non-volatile storage ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M500<br />
<br />
Save current parameters to EEPROM, SD card or other non-volatile storage.<br />
<br />
In [[Redeem]] any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through <code>M906</code> and <code>M907</code> followed by <code>M500</code> will update /etc/redeem/local.cfg.<br />
<br />
==== M501: Read parameters from EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Enable auto-save (only RepRapFirmware)<br />
<br />
;Example<br />
M501<br />
<br />
Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them.<br />
<br />
RepRapFirmware versions prior to 1.17 allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.<br />
<br />
In RepRapFirmware 1.17 and later, the parameters are saved in file sys/config-override.g on the SD card.<br />
<br />
==== M502: Restore Default Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M502<br />
<br />
This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed with <code>M500</code> to reboot with default settings.<br />
<br />
==== M503: Report Current Settings ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{yes}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M503 ; Output current settings<br />
M503 S0 ; Settings as G-code only (Marlin 1.1)<br />
<br />
This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an <code>M92</code> command.<br />
<br />
RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.<br />
<br />
==== M504: Validate EEPROM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.9+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no|Not needed}} | smoothie={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Examples<br />
M504 ; Check EEPROM<br />
<br />
This command checks the contents of EEPROM for correct version, size, and checksum and reports the result.<br />
<br />
==== M505: Firmware dependent ====<br />
<br />
===== M505: Clear EEPROM and RESET Printer =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command erase all EEPROM and reset the board.<br />
<br />
===== M505: Set configuration file folder =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}}:2.03 | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"name"''' ; name of folder, default path is ''/sys/'' if it is a relative path<br />
;Example<br />
:'''M505 P"experimental"''' ; change config file path from ''/sys/'' to ''/sys/experimental/''<br />
<br />
Following this command, files that would normally be fetched from /sys/ (for example, homing files and system macro files in RepRapFirmware) are fetched from the specified folder instead. Any such files that are already being executed will continue to run.<br />
<br />
This command can be used to allow multiple configurations to be maintained easily. In RepRapFirmware the file ''/sys/config/g'' can contain just these two lines:<br />
<br />
M505 P"config1"<br />
M98 P"config.g"<br />
<br />
The first line changes the config file folder to ''/sys/config1'' and the second one executes file ''config.g'' in that folder. To select an alternative configuration, only the first line needs to be edited.<br />
<br />
==== M509: Force language selection ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Resets the language to English.<br />
Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.<br />
<br />
==== M524: Abort SD Printing ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.0+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|Use M25 then M0}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M524<br />
<br />
If an SD print is in progress, this command aborts the print, just as if you had selected "Stop print" from the LCD menu.<br />
<br />
==== M530: Enable printing mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}}<sup>1</sup> }}<br />
<br />
;Example<br />
M530 S1 L270<br />
<br />
This command tells the firmware that a print has started (<code>S1</code>) or ended (<code>S0</code>). The <code>L</code> parameter sets the number of layers. <code>L0</code> denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to <code>M115</code> with an additional line:<br />
<br />
Cap:PROGRESS:1<br />
<br />
;Notes<br />
<sup>1</sup>In MK4duo this command starts print counters for statistics. It also turns off a 30-minute timer for the heaters. If the timer reaches 30, turn off all the heaters.<br />
<br />
==== M531: Set print name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M531 Demo Model<br />
<br />
Sets the name of the currently printed object. Should follow <code>M530 S1</code> for correct display.<br />
<br />
==== M532: Set print progress ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M73}} | prusa={{no}} | repetier={{yes}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M532 X23.7 L56<br />
<br />
Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.<br />
<br />
==== M540: Set MAC address ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> The MAC address<br />
;Examples<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED<br />
M540 PDE:AD:BE:EF:CA:FE<br />
<br />
Sets the [http://en.wikipedia.org/wiki/MAC_address MAC address] of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.<br />
<br />
All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.<br />
<br />
This command is only needed when using older electronics that doesn't provide a unique MAC address, for example Duet 0.6 and Duet 0.8.5.<br />
<br />
==== M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> state, S1=enable, S0=disable<br />
;Example<br />
M540 S1<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M550: Set Name ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Machine name<br />
;Example<br />
M550 PGodzilla<br />
<br />
Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.<br />
<br />
==== M551: Set Password ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Password<br />
;Example<br />
M551 Pmy-very-secret-word<br />
<br />
On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.<br />
<br />
Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.<br />
<br />
==== M552: Set IP address, enable/disable network interface ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> IP address, 0.0.0.0 means acquire an IP address using DHCP<br />
:<code>Snnn</code> (optional) -1 = reset network interface, 0 = disable networking, 1 = enable networking as a client, 2 = enable networking as an access point (WiFi-enabled electronics only)<br />
:<code>Rnnn</code> (optional, RepRapFirmware 1.17 and earlier only) HTTP port, default 80<br />
;Example<br />
M552 P192.168.1.14<br />
<br />
Sets the IP address of the machine to (in this case) 192.168.1.14. If the <code>S</code> parameter is not present then the enable/disable state of the network interface is not changed.<br />
<br />
In RepRapFirmware 1.18 and later the HTTP port address is set using the <code>M586</code> command, so the <code>R</code> parameter of this command is no longer supported.<br />
<br />
M552 with no parameters reports the current network state and IP address.<br />
<br />
==== M553: Set Netmask ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Net mask<br />
;Example<br />
M553 P255.255.255.0<br />
<br />
Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M554: Set Gateway ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Gateway<br />
;Example<br />
M554 P192.168.1.1<br />
<br />
Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.<br />
<br />
Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.<br />
<br />
==== M555: Set compatibility ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Emulation type<br />
;Example<br />
M555 P1<br />
<br />
For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:<br />
<br />
{| class="wikitable"<br />
|P value || Firmware<br />
|-<br />
|0 || Native (i.e. whatever the firmware actually is)<br />
|-<br />
| 1 || [[RepRapFirmware]]<br />
|-<br />
| 2 || [[Marlin]]<br />
|-<br />
| 3 || [[Teacup]]<br />
|-<br />
| 4 || [[Sprinter]]<br />
|-<br />
| 5 || [[Repetier]]<br />
|-<br />
| 6 || [[Marlin]] with changes for nanoDLP<br />
|}<br />
<br />
==== M556: Axis compensation ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Height of the measured distances<br />
:<code>Xnnn</code> Deviation in X direction<br />
:<code>Ynnn</code> Deviation in Y direction<br />
:<code>Znnn</code> Deviation in Z direction<br />
;Example<br />
M556 S100 X0.7 Y-0.2 Z0.6<br />
<br />
[[File:CalibrationAngle.png|thumb|Image denoting how to determine the S parameter for G-code M556]]<br />
<br />
Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem<br />
can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The <code>S</code> parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.<br />
<br />
==== M557: Set Z probe point or define probing grid ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters to define <code>G32</code> probe points (Cartesian/CoreXY printers only, no longer supported in RepRapFirmware)<br />
:<code>Pnnn</code> Probe point number<br />
:<code>Xnnn</code> X coordinate<br />
:<code>Ynnn</code> Y coordinate<br />
;Example<br />
M557 P1 X30 Y40.5<br />
;Parameters to define <code>G29</code> probe grid (all values in mm)<br />
:<code>Xaaa:bbb</code> Minimum and maximum X coordinates to probe<br />
:<code>Yaaa:bbb</code> Minimum and maximum Y coordinates to probe<br />
:<code>Rnnn</code> Radius to probe<br />
:<code>Snn</code> or <code>Sxx:yy</code> Probe point spacing<br />
:<code>Pnn</code> or <code>Pxx:yy</code> Number of probe points in each direction (RepRapFirmware 2.02 and later) - use instead of specifying the spacing<br />
;Examples<br />
M557 X0:200 Y0:220 S20<br />
M557 R150 S15<br />
<br />
Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.<br />
<br />
The first form defines the points for for <code>G32</code> bed probing. The <code>P</code> value is the index of the point (indices start at 0) and the <code>X</code> and <code>Y</code> values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See [[G-code#G32:_Probe_Z_and_calculate_Z_plane|G32]]. Defining the probe points in this way is no longer supported by RepRapFirmware, you should define them in a bed.g file instead.<br />
<br />
The second form defines the grid for <code>G29</code> bed probing. For Cartesian printers, specify minimum and maximum <code>X</code> and <code>Y</code> values to probe and the probing interval. For Delta printers, specify the probing radius. If you define both, the probing area will be the intersection of the rectangular area and the circle. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.<br />
<br />
==== M558: Set Z probe type ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} || grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Z probe type<br />
:<code>Fnnn</code> Feed rate (i.e. probing speed, mm/min)<br />
:<code>Hnnn</code> Dive height (mm)<br />
:<code>Innn</code> Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)<br />
:<code>Rnnn</code> Z probe recovery time after triggering, default zero (seconds) (RepRapFirmware 1.17 and later)<sup>1</sup><br />
:<code>Tnnn</code> Travel speed to and between probe points (mm/min)<br />
:<code>Annn</code> Maximum number of times to probe each point, default 1 (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> Tolerance when probing multiple times, default 0.03 (RepRapFirmware 1.21 and later)<br />
:<code>Bn</code> B1 turns off all heaters during probing moves and during the probe recovery time (RepRapFirmware 1.21 and later)<br />
;Obsolete parameters<br />
:<code>Xnnn</code> If nonzero, use probe for homing X axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Ynnn</code> If nonzero, use probe for homing Y axis (RepRapFirmware 1.19 and earlier only)<br />
:<code>Znnn</code> If nonzero, use probe for homing Z axis (RepRapFirmware 1.19 and earlier only)<br />
;Example<br />
M558 P1 F500 T5000 H3<br />
<br />
A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use:<br />
:P0 indicates that no Z probe is present<br />
:P1 indicates an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1<br />
:P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe<br />
:P3 selects an alternative Z probe similar to P1 but the control signal to the probe low<br />
:P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins)<br />
:P5 (from RepRapFirmware 1.14) selects a switch or a digital output device to the In pin of the Z-probe connector<br />
:P6 is as P4 but the switch is connected to and alternative connector (on the Duet series, the E1 endstop connector)<br />
:P7 is as P4 but the switch is connected to and alternative connector (on the Duet series, the Z endstop connector)<br />
:P8 is as P5 but the signal is unfiltered for faster response<br />
:P9 is as P5 but the probe is deployed and retracted at every probe point. This is intended for BLTouch.<br />
<br />
Related codes: G29, G30, G31, G32, M401, M402.<br />
<br />
==== M559: Upload configuration file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M559<br />
<br />
If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending <code>M559</code>, the file should be sent, ending with an <code>M29</code> (q.v.).<br />
<br />
==== M560: Upload web page file ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M560<br />
<br />
For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending <code>M560</code> the file (usually an HTML file) should be sent, terminated by the string <pre><!-- **EoF** --></pre>. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...<br />
<br />
<br />
==== M561: Set Identity Transform ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M561<br />
<br />
This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.<br />
<br />
==== M562: Reset temperature fault ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M562 P2<br />
<br />
Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.<br />
<br />
Later versions of RepRapFirmware support M562 without the P parameter, which will reset all heater faults.<br />
<br />
==== M563: Define or remove a tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>S"name"</code> Tool name (optional)<br />
:<code>Dnnn</code> Extruder drive(s)<br />
:<code>Hnnn</code> Heater(s)<br />
:<code>Fnnn</code> Fan(s) to map the print cooling fan to (RepRapFirmware 1.16 and later)<br />
:<code>Xnnn</code> Axis or axes to map X movement to (RepRapFirmware 1.16 and later)<br />
:<code>Ynnn</code> Axis or axes to map Y movement to<br />
:<code>Lnnn</code> Drive to use for filament mapping. By default RRF will use the first and only extruder drive if this parameter is not specified (supported by RRF >= 2.02)<br />
;Examples<br />
M563 P0 D0:2:3 H1:3 ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3<br />
M563 P1 D1 H2 X3 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis<br />
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2,<br />
; with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2<br />
M563 P3 D0 H1 S"Chocolate extruder" ; create a named tool using extruder drive 0 and heater 1<br />
<br />
Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.<br />
<br />
Tools are driven using multiple values in the 'E' field of <code>G1</code> commands, each controlling the corresponding drive in the 'D' field above, as follows:<br />
<br />
G1 X90.6 Y13.8 E2.24:2.24:15.89<br />
G1 X70.6 E0:0:42.4<br />
<br />
The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.<br />
<br />
Alternatively, if the slicer does not support generating <code>G1</code> commands with multiple values for the extrusion amount, the <code>M567</code> command can be used to define a tool mix ratio.<br />
<br />
Normally an <code>M563</code> command is immediately followed by a <code>G10</code> command to set the tool's offsets and temperatures.<br />
<br />
It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.<br />
<br />
The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see <code>M584</code>) and the X mapping option in <code>M563</code> defines which carriage or carriages are used.<br />
<br />
If you use the <code>M563</code> command with a <code>P</code> value for a tool that has already been defined, that tool is redefined using the new values you provide.<br />
<br />
RepRapFirmware supports an additional form of the <code>M563</code> command. The command:<br />
<br />
M563 S1<br />
<br />
means add 1 (the value of the <code>S</code> parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new <code>M563</code> command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.<br />
<br />
Recent versions of RepRapFirmware allow the deletion of existing tools if <code>M563</code> is called in this way:<br />
<br />
M563 P1 D-1 H-1<br />
<br />
==== M564: Limit axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|M211 S}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Hnnn</code> H1 = forbid movement of axes that have not been homed, H0 = allow movement of axes that have not been homed (RepRapFirmware 1.21 and later)<br />
:<code>Snnn</code> S1 = limit movement within axis boundaries, S0 = allow movement outside boundaries<br />
;Example<br />
:M564 S0 H0<br />
<br />
Allow moves outside the print volume and before homing, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. Likewise if the H parameter is 0 you can move the head or bed along axes that have not been homed. The default behaviour is S1 H1. On some types of printer (e.g. Delta and SCARA), movement before homing is prohibited regardless of the H parameter.<br />
<br />
==== M565: Set Z probe offset ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware= {{yes|use G31}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M565 X3 Y4.5 Z-2.37<br />
<br />
Set the offset from the extruder tip to the probe position. The <code>X</code>, <code>Y</code>, and <code>Z</code> values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See <code>G32</code>.<br />
<br />
==== M566: Set allowable instantaneous speed change ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Maximum instantaneous speed change of the X axis (mm/min)<br />
:<code>Ynnn</code> Maximum instantaneous speed change of the Y axis<br />
:<code>Znnn</code> Maximum instantaneous speed change of the Z axis<br />
:<code>Ennn</code> Maximum instantaneous speed change of the extruder drives<br />
;Example<br />
M566 X20 Y20 Z2 E10<br />
<br />
Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.<br />
<br />
The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.<br />
<br />
If you set these <code>X</code> and <code>Y</code> values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.<br />
<br />
On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.<br />
<br />
==== M567: Set tool mix ratios ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Tool number<br />
:<code>Ennn</code> Mix ratios<br />
;Example<br />
M567 P2 E0.1:0.2:0.1:0.6<br />
<br />
This example sets the mix ratio for tool 2 (the <code>P</code> value). When mixing is then turned on (see <code>M568</code>), only single <code>E</code> values need to be sent on a <code>G1</code> command (any extra <code>E</code> values will be ignored, but are not illegal):<br />
<br />
G1 X20 E1.3<br />
<br />
This will move to X=20 extruding a total length of filament of 1.3mm. The first drive of tool 2 will extrude 0.1*1.3mm, the second 0.2*1.3mm and so on. The ratios don't have to add up to 1.0 - the calculation done is as just described. But it is best if they do.<br />
<br />
See also <code>M568</code>.<br />
<br />
==== M568: Turn off/on tool mix ratios (obsolete) ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
This command is obsolete. When using a tool defined as a mixing extruder, RepRapFirmware applies the mix ratio defined by M567 whenever only one E parameter is provided in G1 commands. When multiple colon-separated E values are provided in the G1 command, they will be used as the individual amounts to extrude.<br />
<br />
==== M569: Stepper driver control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Motor driver number<br />
:<code>Sn</code> Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)<br />
:<code>Rn</code> Driver enable polarity: 0 = active low, 1 = active high (default 0)<br />
:<code>Tnn</code> Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)<br />
:<code>Taa:bb:cc:dd</code> Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)<br />
:<code>Dnn</code> Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop <br />
:<code>Fnn</code> (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15<br />
:<code>Bnn</code> (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.<br />
:<code>Yaa:bb</code> or <code>Yaa:bb:cc</code> (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.<br />
:<code>Cnnn</code> Custom chopper control register value (RepRapFirmware 2.0 and later). '''Do not change this value without having a good understanding of the stepper driver driver chip!'''<br />
:<code>Hnn</code> (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.<br />
:<code>Vnnn</code> (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.<br />
;Example<br />
M569 P0 S0 ; reverse the direction of the motor attached to driver 0<br />
M569 P5 R1 T2.5:2.5:5:0 ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time<br />
<br />
;Notes<br />
<br />
All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.<br />
<br />
The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest <code>T</code> parameters seen in any M569 command, and applies those values to all drivers for which any nonzero <code>T</code> parameters were specified.<br />
<br />
The modes (D parameter) supported by various stepper driver chips are:<br />
<br />
:TMC2130, TMC2160, TMC5160: modes 0,1,2,3<br />
:TMC2660: modes 0,1,2<br />
:TMC2208/2209/2224: modes 2,3 (mode 3 is stealthChop 2)<br />
<br />
Some versions of RepRapFirmware prior to 1.14 also provided <code>X</code>, <code>Y</code>, <code>Z</code> and <code>E</code> parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.<br />
<br />
==== M569.1: Stepper driver closed loop control ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pn</code> or <code>Pn.n</code> Motor driver number, or board address and driver number<br />
:<code>Sn</code> Mode: 0=open loop (default), 1=closed loop (requires an encoder to be selected, see the T parameter)<br />
:<code>Tn</code> Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=AS5047D encoder on motor shaft, 4=TLI5012B encoder on motor shaft<br />
:<code>En.n</code> Encoder counts per mm (linear encoder) or per rotation (rotary encoder). Only used if the encoder type is 1 or 2.<br />
:<code>Rn.n</code> Proportional constant<br />
:<code>In.n</code> Integral constant<br />
:<code>Dn.n</code> Derivative constant<br />
<br />
Supported by RepRapFirmware on boards using closed loop drivers.<br />
<br />
==== M570: Configure heater fault detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters for RepRapFirmware 1.14 and earlier<br />
:<code>Snnn</code> Heater timeout (in seconds)<br />
;Example<br />
M570 S120<br />
<br />
After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.<br />
<br />
;Parameters for RepRapFirmware 1.15e and later<br />
:<code>Hnnn</code> Heater number<br />
:<code>Pnnn</code> Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)<br />
:<code>Tnnn</code> Permitted temperature excursion from the setpoint for this heater (default 10C)<br />
:<code>Snnn</code> Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)<br />
;Example<br />
M570 H1 P4 T15<br />
<br />
'''Warning!''' Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.<br />
<br />
==== M571: Set output on extrude ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Output value<br />
:<code>Fnnn</code> Output PWM frequency (RepRapFirmware 1.17 and later)<br />
:<code>Pnnn</code> Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until <code>M571</code> with a <code>P</code> parameter has been seen<br />
;Example<br />
M571 P3 F200<br />
M571 S0.5<br />
<br />
This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The <code>S</code> parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.<br />
<br />
In RepRapFirmware 1.17 and later you can use the <code>P</code> parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and <code>M280</code> commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using <code>M307</code>, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.<br />
<br />
==== M572: Set or report extruder pressure advance ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Dnnn</code> Extruder number<br />
:<code>Snnn</code> Pressure advance amount (in seconds)<br />
;Example<br />
M572 D0 S0.1<br />
<br />
This sets the pressure advance coefficient (<code>S</code> parameter) for the specified extruder (<code>D</code> parameter). Supported by RepRapFirmware-dc42, -ch and -dn.<br />
<br />
Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.<br />
<br />
With Bowden extruders, an <code>S</code> value between 0.1 and 0.2 usually gives the best print quality.<br />
<br />
Older versions of RepRapFirmware used the <code>P</code> parameter to specify the drive number, instead of using D to specify the extruder number.<br />
<br />
==== M573: Report heater PWM ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Heater number<br />
;Example<br />
M573 P1<br />
<br />
This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.<br />
<br />
==== M574: Set endstop configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
: '''Xnnn''' Switch position for X axis<br />
: '''Ynnn''' Switch position for Y axis<br />
: '''Znnn''' Switch position for Z axis<br />
: '''Snnn''' Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection<br />
; Example<br />
: M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high<br />
<br />
This defines the position of [[Glossary_of_Terms#Endstop| endstop]] sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default), low (S0), or the axes listed use the Z probe for homing that axis (S2), or motor stall detection (S3). A normally-closed endstop switch wired in the usual way produces an active high output (S1). If different axes use different types of endstop sensing, you can use more than one M574 command.<br />
<br />
On delta printers the XYZ parameters refer to the towers, and the endstops should normally all be high end (i.e. at the top of the towers).<br />
<br />
The S2 and S3 options are supported in RepRapFirmware 1.20 and later.<br />
<br />
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.<br />
<br />
==== M575: Set serial comms parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0+}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot-{{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Serial channel number<br />
:<code>Bnnn</code> Baud rate<br />
:<code>Snnn</code> Whether checksums should be used<br />
;Example<br />
M575 P1 B57600 S1<br />
<br />
This sets the communications parameters of the serial comms channel specified by the <code>P</code> parameter. <code>P0</code> specifies the main serial interface (typically a USB port, or serial-over-USB), while <code>P1</code> specifies an auxiliary serial port (for example, the port used to connect a PanelDue). The <code>B</code> parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port). The <code>S</code> parameter is a bitmap of features. The lowest bit, if set, specifies that only commands that include a valid checksum should be accepted from this comms channel.<br />
<br />
==== M577: Wait until endstop is triggered ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Desired endstop level<br />
:<code>Xnnn</code> Select X axis endstop<br />
:<code>Ynnn</code> Select Y axis endstop<br />
:<code>Znnn</code> Select Z axis endstop<br />
:<code>Ennn</code> Select extruder drive endstop<br />
;Example<br />
M577 E0 S1<br />
<br />
Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.<br />
<br />
The following trigger types may be used using the 'S' parameter:<br />
<br />
0: Endstop not hit<br />
1: Low endstop hit<br />
2: High endstop hit<br />
3: Near endstop (only Z probe)<br />
<br />
==== M578: Fire inkjet bits ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Inkjet head number<br />
:<code>Snnn</code> Bit pattern<br />
;Example<br />
M578 P3 S5<br />
<br />
This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the <code>P</code> parameter is ommitted inkjet 0 is assumed.<br />
<br />
This is a version of the M700 command used by the [[Inkshield]], but unfortunately M700 is already taken so cannot be used for that in the standard.<br />
<br />
==== M579: Scale Cartesian axes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Scale factor for X axis<br />
:<code>Ynnn</code> Scale factor for Y axis<br />
:<code>Znnn</code> Scale factor for Z axis<br />
;Example<br />
M579 X1.0127 Y0.998<br />
<br />
On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).<br />
<br />
==== M580: Select Roland ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Rnnn</code> Whether Roland mode should be activated<br />
:<code>Pnnn</code> Initial text to send to the Roland controller<br />
;Example<br />
M580 R1 PVS4;!VZ2;!MC1;<br />
<br />
This is not really anything to do with RepRap, but it is convenient. The [http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html little Roland mills] are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to [http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf Roland RML language]. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the <code>R</code> field is 0. The optional <code>P</code> string is sent to the Roland if <code>R</code> is 1. It is permissible to call this repeatedly with <code>R</code> set to 1 and different strings in the <code>P</code> field to communicate directly with a Roland.<br />
<br />
==== M581: Configure external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Tnn</code> Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)<br />
:<code>X, Y, Z, E</code> Selects endstop input(s) to monitor<br />
:<code>P</code> Reserved, may be used in future to allow general I/O pins to cause triggers<br />
:<code>S</code> Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.<br />
:<code>C</code> Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)<br />
;Example<br />
M581 E1:2 S1 T2 C1 ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card<br />
<br />
When <code>M581</code> is executed, if the <code>T</code> parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using <code>S-1</code> with no <code>X</code>, <code>Y</code>, <code>Z</code> or <code>E</code> parameters sets the trigger back to ignoring all inputs.<br />
<br />
In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if <code>M112</code> had been received. Trigger number 1 causes the print to be paused as if <code>M25</code> had been received. Any trigger number # greater then 1 causes the macro file <code>sys/trigger#.g</code> to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the <code>M400</code> command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.<br />
<br />
==== M582: Check external trigger ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:T Trigger number to poll<br />
;Example<br />
M582 T2 ; check levels of inputs that give rise to trigger #2<br />
<br />
Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.<br />
<br />
For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.<br />
<br />
==== M584: Set drive mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.14+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> Driver number(s) for X motor(s)<br />
:<code>Ynnn</code> Driver number(s) for Y motor(s)<br />
:<code>Znnn</code> Driver number(s) for Z motor(s)<br />
:<code>U,V,W, A, B, Cnnn</code> Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)<br />
:<code>Ennn</code> Driver number(s) for E motor(s)<br />
:<code>Pnnn</code> Number of visible axes, defaults to the total number of axes configured.<br />
;Example<br />
:M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors<br />
<br />
Assigning a drive using <code>M584</code> does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.<br />
<br />
You can use <code>M584</code> to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.<br />
<br />
On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.<br />
<br />
==== M585: Probe Tool ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).<br />
<br />
;Parameter must be only one of:<br />
:<code>Xnnn</code><br />
:<code>Y-nnn</code><br />
:<code>Znnn</code><br />
<br />
Where the absolute value of <code>nnn</code> is the radius of the tool plus the radius of the probe in that direction. So <code>M585 X1.5</code> will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of <code>nnn</code> is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.<br />
<br />
So the process should be:<br />
<br />
:Set the values as closely as known in the <code>G10</code> command.<br />
:Move to a position slightly offset from the probe then execute <code>M585</code>s in X, Y and Z in the tool selection macro to set them precisely.<br />
<br />
After this, the <code>G10</code> command on its own can be used to report the values.<br />
<br />
==== M586: Configure network protocols ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.18+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnn</code> Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the <code>T</code> parameter)<br />
:<code>Snn</code> 0 = disable this protocol, 1 = enable this protocol<br />
:<code>Rnn</code> TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.<br />
:<code>Tnn</code> 0 = don't use TLS, 1 = use TLS. Ignored unless <code>S</code> = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If <code>T1</code> is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.<br />
<br />
M586 with no <code>S</code> parameter reports the current support for the available protocols.<br />
<br />
RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.<br />
<br />
==== M587: Store WiFi host network in list, or list stored networks ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> Network SSID<br />
:<code>Pccc</code> Network password<br />
:<code>Inn.nn.nn.nn</code> (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.<br />
:<code>Jnn.nn.nn.nn</code> (optional) Gateway IP address to use when connected to this network.<br />
:<code>Knn.nn.nn.nn</code> (optional) Netmask to use when connected to this network<br />
<br />
If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.<br />
<br />
<code>M587</code> with no parameters lists all stored SSIDs, but not the stored passwords.<br />
<br />
==== M588: Forget WiFi host network ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> SSID to remove from the networks list<br />
<br />
The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.<br />
<br />
==== M589: Configure access point parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Sccc</code> The SSID that the WiFi interface should use when it is commanded to run as an access point<br />
:<code>Pccc</code> The WiFi password<br />
:<code>Inn.nn.nn.nn</code> The IP address to use<br />
<br />
Note: WPA2 security will be used by default.<br />
<br />
==== M590: Report current tool type and index ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.<br />
<br />
;Example<br />
> M590<br />
> echo: Extruder 0x00<br />
<br />
==== M591: Configure filament monitoring ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.21+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.<br />
<br />
;Parameters<br />
:'''Cnn''' Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.<br />
:'''Dnn''' Extruder drive number (0, 1, 2...),<br />
:'''Pnn''' Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :'''Snn''' S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.<br />
5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor<br />
<br />
;Additional parameters for Duet3D laser filament monitor<br />
:'''Raa:bb''' Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused<br />
:'''Enn''' minimum extrusion length before a commanded/measured comparison is done, default 3mm<br />
<br />
;Additional parameters for Duet3D rotating magnet filament monitor<br />
:'''Lnn''' Filament movement per complete rotation of the sense wheel, in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Additional parameters for a pulse generating filament monitor<br />
:'''Lnn''' Filament movement per pulse in mm<br />
:'''R, E''' As for Duet3D laser filament monitor<br />
<br />
;Examples<br />
:M591 D0 C3 P5 S1 R70:130 L24.8 E6.0 ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length<br />
:M591 D1 ; display filament sensor parameters for extruder drive 1<br />
<br />
Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.<br />
<br />
==== M592: Configure nonlinear extrusion ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20.1+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Dnn''' Extruder drive number (0, 1, 2...)<br />
:'''A'''nnn A coefficient in the extrusion formula, default zero<br />
:'''B'''nnn B coefficient in the extrusion formula, default zero<br />
:'''L'''nnn Upper limit of the nonlinear extrusion compensation, default 0.2<br />
:'''T''' nnn Reserved for future use, for the temperature at which these values are valid<br />
;Example<br />
:M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0<br />
:M592 D0 ; report parameters for drive 0<br />
<br />
Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.<br />
<br />
Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.<br />
<br />
Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.<br />
<br />
==== M593: Configure Dynamic Acceleration Adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Fnnn''' Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.<br />
;Example<br />
:M593 F40.5<br />
<br />
This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.<br />
<br />
DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.<br />
<br />
To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.<br />
<br />
Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.<br />
<br />
==== M594: Enter/Leave Height Following mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|3.0+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pn''' P1 = enter height following mode, P0 = leave height following mode<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.<br />
<br />
If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.<br />
<br />
==== M600: Set line cross section ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M600 P0.061<br />
<br />
Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.<br />
<br />
==== M600: Filament change pause ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}}<sup>1</sup> | smoothie={{yes}} | reprapfirmware={{yes|2.02 and later}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Pause for filament change.<br />
<br />
;Parameters<br />
:<code>X[pos]</code><br />
:<code>Y[pos]</code><br />
:<code>Z[relative lift]</code><br />
:<code>E[initial retract]</code><br />
:<code>L[later retract distance for removal]</code><br />
:<code>AUTO</code> Automatically (only Prusa Firmware with MMU connected)<sup>1</sup><br />
<br />
;Example<br />
M600<br />
<br />
In SmoothieWare:<br />
<br />
The variable "after_suspend_gcode" is run after <code>M600</code>. <br />
<br />
For example:<br />
<br />
after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # gcode to run after suspend, retract then get head out of way<br />
<br />
In RepRapFirmware, <code>M600</code> causes macro file filament-change.g to be run if it exists, otherwise it falls back to pause.g. The parameters in the <code>M600</code> command are ignored.<br />
<br />
;Notes<br />
In Prusa Firmware this command is also used when the Filament Runout Sensor triggers. To prevent filament blobs it will raise to 25 mm if it has been triggered below 25 mm layer height. Default are X=211 mm, Y=0 mm, Z=2 mm, E=-2 mm, L=-80 mm<sup>1</sup><br />
<br />
==== M601: Pause print ====<br />
{{Firmware Support | reprapfirmware={{yes|3.01 and later, or use M226}} | prusa={{yes}} }}<br />
<br />
Pauses print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M602: Resume print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M24}} | prusa={{yes}} }}<br />
<br />
Resumes print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
==== M603: Stop print ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M0}} | prusa={{yes}} }}<br />
<br />
Stops print on Prusa i3 MK2/s,MK2.5/s,MK3/s.<br />
<br />
(In development)<br />
Prusa-mini specific : M603 Configure filament change<br />
;Parameters<br />
:<code>T[toolhead]</code> Select extruder to configure, active extruder if not specified (not used yet)<br />
:<code>U[distance]</code> Retract distance for removal, for the specified extruder.<br />
:<code>L[distance]</code> Extrude distance for insertion, for the specified extruder.<br />
<br />
==== M605: Set dual x-carriage movement mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | reprapfirmware={{yes|Use M563}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set Dual X-Carriage movement mode.<br />
<br />
;Parameters<br />
:<code>S[mode]</code> Mode (see below)<br />
:<code>X[duplication x-offset]</code> Optional X offset for Mode 2<br />
:<code>R[duplication temp offset]</code> Optional temperature difference for Mode 2<br />
<br />
;Example<br />
M605 S1 ; Set mode to auto-park<br />
<br />
<code>M605 S0</code>: Full control mode. The slicer has full control over x-carriage movement<br />
<code>M605 S1</code>: Auto-park mode. The inactive head will auto park/unpark without slicer involvement<br />
<code>M605 S2 [Xnnn] [Rmmm]</code>: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of <code>mmm</code> degrees. E.g., with "<code>M605 S2 X100 R2</code>" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.<br />
<br />
RepRapFirmware does not implement M605 because it supports dual carriage mode, duplication mode, auto park, different temperatures etc. using the M563 tool definition command and the tool change macro files.<br />
<br />
==== M650: Set peel move parameters ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. If using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.<br />
<br />
==== M651: execute peel move ====<br />
{{Firmware Support | marlin={{no}} | prusa={{no}} | grbl={{no}} | repetier={{no}} | redeem={{no}}| reprapfirmware={{yes|2.02}} }}<br />
<br />
This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.<br />
<br />
==== M665: Set delta configuration ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Lnnn</code> Diagonal rod length<br />
:<code>Rnnn</code> Delta radius<br />
:<code>Snnn</code> Segments per second<sup>1</sup><br />
:<code>Bnnn</code> Safe probing radius<sup>2,3</sup><br />
:<code>Hnnn</code> Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections <sup>2</sup><br />
<br />
:<code>Xnnn</code> X tower position correction<sup>2,4</sup><br />
:<code>Ynnn</code> Y tower position correction<sup>2,4</sup><br />
:<code>Znnn</code> Z tower position correction<sup>2,4</sup><br />
<br />
:<code>Annn</code> X tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Bnnn</code> Y tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
:<code>Cnnn</code> Z tower diagonal rod trim.<sup>1</sup> (Marlin 2.0.6+)<br />
<br />
;Examples<br />
M665 L250 R160 S200 ; (Marlin)<br />
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)<br />
<br />
Set the delta calibration variables. (See the discussion page for notes on this implementation.)<br />
<br />
;Notes<br />
<br />
<sup>1</sup>Only supported on Marlin.<br />
<br />
<sup>2</sup>Only supported in RepRapFirmware and Marlin 1.1.0.<br />
<br />
<sup>3</sup> In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.<br />
<br />
<sup>4</sup>X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.<br />
In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.<br />
<br />
==== M666: Set delta endstop adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X axis endstop adjustment<br />
:<code>Ynnn</code> Y axis endstop adjustment<br />
:<code>Znnn</code> Z axis endstop adjustment<br />
:<code>Annn</code> X bed tilt in percent<sup>1</sup><br />
:<code>Bnnn</code> Y bed tilt in percent<sup>1</sup><br />
;Example<br />
M666 X-0.1 Y+0.2 Z0<br />
<br />
Sets delta endstops adjustments.<br />
<br />
In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.<br />
<br />
In Marlin, only negative endstop corrections are allowed.<br />
From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.<br />
<br />
In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.<br />
<br />
<sup>1</sup>RepRapFirmware 1.16 and later.<br />
<br />
==== M667: Select CoreXY mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> CoreXY mode<br />
:<code>Xnnn</code> X axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Ynnn</code> Y axis scale factor (RepRapFirmware 2.02 and earlier)<br />
:<code>Znnn</code> Z axis scale factor (RepRapFirmware 2.02 and earlier)<br />
;Example<br />
M667 S1<br />
<br />
<code>M667 S0</code> selects Cartesian mode (unless the printer is configured as a delta using the <code>M665</code> command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.<br />
<br />
<code>M667 S1</code> selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.<br />
<br />
<code>M667 S2</code> selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.<br />
<br />
RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.<br />
<br />
To change the motor directions, see the M569 command.<br />
<br />
==== M668: Set Z-offset compensations polynomial ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|dc42-cmm}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through <code>M668</code>. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.<br />
<br />
For the polynomial used, 40 parameters are specified. The <code>I</code> parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.<br />
<br />
<code>M668 Ix S[list of values]</code> sets the polynomial parameters starting at index x, if index present and != 0.<br />
<br />
<code>M668 R</code> recomputes the grid based on the current parameters.<br />
<br />
<code>M668 P[0|1]</code> turns off or on the polynomial compensation.<br />
<br />
;Typical usage:<br />
M668 I1 S4.882E-17:0.0<br />
M668 I3 ...<br />
...<br />
M668 R P1<br />
<br />
Which sets the list, computes the interpolation grid, and then enables compensation.<br />
<br />
==== M669: Set kinematics type and kinematics parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Knnn''' Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron<br />
<br />
Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported<br />
<br />
; Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)<br />
: '''Xnnn''', '''Ynnn''', '''Znnn''', '''Unnn''' etc. (optional) Movement matrix coefficients. For example. <code>X1:-1:0</code> tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.<br />
<br />
; Parameters for serial SCARA kinematics <br />
:'''Pnnn''' Proximal arm length (mm)<br />
:'''Dnnn''' Distal arm length (mm)<br />
:'''Annn:nnn''' Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis <br />
:'''Bnnn:nnn''' Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line<br />
:'''Cnnn:nnn:nnn''' Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.<br />
:'''Snnn''' Segments per second if smooth XY motion is approximated by means of segmentation<br />
:'''Tnnn''' Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation<br />
:'''Xnnn''' X offset of bed origin from proximal joint<br />
:'''Ynnn''' Y offset of bed origin from proximal joint<br />
;Examples<br />
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0<br />
<br />
The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.<br />
<br />
;Parameters for Polar kinematics<br />
:'''Raaa:bbb''' Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.<br><br />
:'''Hnnn''' Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.<br><br />
:'''Fnnn''' Maximum turntable speed in degrees per second<br />
:'''Annn''' Maximum turntable acceleration in degrees per second per second<br />
:'''Snnn''', '''Tnnn''' As for serial SCARA kinematics<br />
<br />
==== M670: Set IO port bit mapping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnn:nn:nn...''' List of logical port numbers that bits 0, 1, 2... control<br />
:'''Tnnn''' port switching time advance in milliseconds<br />
<br />
RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.<br />
<br />
==== M671: Define positions of Z leadscrews or bed leveling screws ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no|M422}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Xnn:nn:nn...''' List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Ynn:nn:nn...''' List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws<br />
:'''Snn''' Maximum correction to apply to each leadscrew in mm (optional, default 1.0)<br />
:'''Pnnn''' Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.<br />
;Example<br />
:M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0 ; Z leadscrews are at (-15,220), (100,-20) and (215,220)<br />
<br />
Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.<br />
<br />
For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.<br />
<br />
==== M672: Program Z probe ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.19+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Snn:nn:nn...''' Sequence of 8-bit unsigned values to send to the currently-selected Z probe<br />
;Example<br />
:M671 S50:205<br />
<br />
This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.<br />
<br />
==== M673: Align plane on rotary axis ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''U,V,W,A,B,C''' Rotary axis letter on which the plane is mounted<br />
:'''Pnnn''' Factor to multiply the correction angle (degrees) with (defaults to 1)<br />
;Example<br />
:M673 A<br />
<br />
This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first.<br />
Supported in RepRapFirmware 2.02 and later.<br />
<br />
==== M674: Set Z to center point ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|TBD}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.<br />
<br />
==== M675: Find center of cavity ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|2.02+}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
; Parameters<br />
:'''X,Y,Z''' Axis to probe on<br />
:'''Fnnnn''' Probing feedrate<br />
:'''Rnnn''' Distance to move away from the lower endstop before the next probing move starts<br />
; Example<br />
: M675 X R2 F1200<br />
<br />
This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.<br />
<br />
==== M700: Level plate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M671,G32}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
;Example<br />
M700<br />
<br />
Script to adjust the plate level.<br />
<br />
==== M701: Load filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament load. ''This command can be used without any additional parameters.''<br />
<br />
;Parameters<br />
:<code>Snn</code> Filament to load (RepRapFirmware)<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Lnn</code> Length to use for load (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
;With no parameters:<br />
* RepRapFirmware will report the name of the loaded filament (if any).<br />
* Marlin Firmware initiates a Filament Load.<br />
<br />
;Examples<br />
M701<br />
M701 S"PLA" ; Only in RepRapFirmware<br />
M701 T0 ; Only in Marlin.<br />
<br />
RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...<br />
<br />
# Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)<br />
# Change the filament name of the associated tool, so it can be reported back to Duet Web Control<br />
<br />
==== M702: Unload filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.19+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Initiate a filament unload. ''This command can be used without any additional parameters.'' In contrast to <code>M701</code> this code is intended to unload the previously loaded filament from the selected tool.<br />
<br />
;Parameters<br />
:<code>Tnn</code> Tool to load (Marlin)<br />
:<code>Unn</code> Length to use for unload (Marlin)<br />
:<code>Znn</code> Z raise to perform (Marlin)<br />
<br />
In response to <code>M702</code> RepRapFirmware will do the following:<br />
<br />
# Run the macro file "unload.g" in the subdirectory of the given material (e.g. <code>/filaments/PLA/unload.g</code>)<br />
# Change the filament name of the current tool, so it can be reported back to Duet Web Control<br />
<br />
;Examples<br />
M702 ; Unload filament as previously configured<br />
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm<br />
<br />
==== M703: Configure Filament ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
# In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run <code>/filaments/<loaded filament>/config.g</code> which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.<br />
<br />
If the filaments feature is used, it is recommended to put this code into <code>tpost*.g</code> to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.<br />
<br />
==== M710: Firmware dependent ====<br />
<br />
===== M710: Controller Fan settings =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|2.0.5.2+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
<br />
;Parameters<br />
:''With no parameters, report current settings.''<br />
:<code>A[bool]</code> Turn Auto Mode on or off.<br />
:<code>Snnn</code> Set the Active Speed (0-255) used when motors are enabled.<br />
:<code>Innn</code> Set the Idle Speed (0-255) used when motors are disabled.<br />
:<code>Dnnn</code> Set the Idle Duration (seconds) to keep the fan running after motors are disabled.<br />
:<code>R</code> Reset to defaults.<br />
<br />
;Example<br />
M710 S200 ; Set "active" fan speed to 200<br />
<br />
===== M710: Erase the EEPROM and reset the board =====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{partial|M999}} | smoothie={{no}} | klipper={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command only exists in a defunct bq fork of Marlin Firmware.<br />
<br />
;Example<br />
M710<br />
<br />
==== M750: Enable 3D scanner extension ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M750<br />
<br />
This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.<br />
<br />
==== M751: Register 3D scanner extension over USB ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M751<br />
<br />
When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.<br />
<br />
==== M752: Start 3D scan ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code>: Length/degrees of the scan<br />
:<code>Rnnn</code>: Resolution (new in RRF 2.0) [optional, defaults to 100]<br />
:<code>Nnnn</code>: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]<br />
:<code>Pnnn</code>: Filename for the scan<br />
;Example<br />
M752 S300 Pmyscan<br />
<br />
Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.<br />
<br />
==== M753: Cancel current 3D scanner action ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M753<br />
<br />
Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.<br />
<br />
==== M754: Calibrate 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Nnnn''' Calibration mode (0=linear [default], 1=rotary)<br />
<br />
;Example<br />
M754<br />
<br />
Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.<br />
<br />
==== M755: Set alignment mode for 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Whether to turn on (> 0) or off (<= 0) the alignment feature<br />
;Examples<br />
M755 P1<br />
M755 P0<br />
<br />
Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.<br />
<br />
==== M756: Shutdown 3D scanner ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.18+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M756<br />
<br />
Sends the SHUTDOWN command the attached 3D scanner.<br />
<br />
==== M800: Fire start print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M800<br />
<br />
==== M801: Fire end print procedure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|bq}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{partial|bq}} }}<br />
<br />
<sup>1</sup> only in bq-Marlin Firmware<br />
<br />
;Example<br />
M801<br />
<br />
==== M851: Set Z-Probe Offset ====<br />
{{Firmware Support | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{yes|2.02 and later, or use G31}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with G28. This value may also be used by G29 to apply correction to the Z position.<br />
<br />
This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch. (This is a common setup on delta machines.)<br />
<br />
This setting is saved in the EEPROM by M500 and restored by <code>M501</code>. The default (as reset by M502) is set by the Z_PROBE_OFFSET_FROM_EXTRUDER setting in Configuration.h.<br />
<br />
Note that in Marlin 1.1.0 and later <code>M851</code> sets the value literally as given, while Marlin 1.0.2 negates the absolute value.<br />
<br />
The examples below will set the Z-probe Z offset to -4mm (below the nozzle):<br />
<br />
===== M851 in Marlin 1.0.2 =====<br />
<br />
M851 Z4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 1.1.0 =====<br />
<br />
M851 Z-4 ; Set the Z probe offset to -4<br />
<br />
===== M851 in Marlin 2.0.0 =====<br />
<br />
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets<br />
<br />
===== M851 in MK4duo 4.3.25 =====<br />
<br />
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4<br />
<br />
===== M851 in RepRapFirmware 2.02 and later =====<br />
<br />
M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.<br />
<br />
===== M860 Wait for Probe Temperature =====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnnn</code> Target temperature<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will wait for the PINDA thermistor to reach a target temperature.<br />
<br />
===== M861 Set Probe Thermal Compensation =====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|Use G31}} | bfb={{no}} | makerbot={{no}} | grbl={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>?</code> Print current EEPROM offset values<br />
:<code>!</code> Set factory default values<br />
:<code>Z</code> Set all values to 0 (effectively disabling PINDA temperature compensation)<br />
:<code>S</code> Microsteps<br />
:<code>I</code> Table index<br />
<br />
;Example<br />
M861 ?<br />
<br />
Results<br />
PINDA cal status: 1<br />
index, temp, ustep, um<br />
n/a, 35, 0, 0.00<br />
0, 40, 0, 0.00<br />
1, 45, 0, 0.00<br />
2, 50, 0, 0.00<br />
3, 55, 0, 0.00<br />
4, 60, 0, 0.00<br />
<br />
;Notes<br />
In [[Prusa Firmware]] this command will set / read the PINDA temperature compensation offsets.<br />
<br />
==== M862: Print checking ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Checks the parameters of the printer and gcode and performs compatibility check<br />
<br />
===== M862.1: Check nozzle diameter =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Nozzle diameter 0.25 /0.40 /0.60<br />
:<code>Q</code> Current nozzle diameter<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''Printer nozzle diameter differs from the G-code. Continue?''<br />
:<code>strict</code> ''Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.''<br />
<br />
===== M862.2: Check model code =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa model<br />
:<code>Q</code> Current model<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
Accepted printer type identifiers and their numeric counterparts:<br />
- MK1 (100)<br />
- MK2 (200) <br />
- MK2MM (201) <br />
- MK2S (202) <br />
- MK2SMM (203) <br />
- MK2.5 (250) <br />
- MK2.5MMU2 (20250) <br />
- MK2.5S (252) <br />
- MK2.5SMMU2S (20252)<br />
- MK3 (300)<br />
- MK3MMU2 (20300)<br />
- MK3S (302)<br />
- MK3SMMU2S (20302)<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.3: Model name =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>P"nnnn"</code> nnnn = Prusa model name<br />
:<code>Q</code> Current model name<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
It accepts text identifiers of printer types too.<br />
The syntax of M862.3 is (note the quotes around the type):<br />
<br />
:<code>M862.3 P "MK3S"</code><br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different printer type. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.''<br />
<br />
===== M862.4: Firmware version =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Prusa firmware version<br />
:<code>Q</code> Current firmware version<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a newer firmware. Continue?''<br />
:<code>strict</code> ''G-code sliced for a newer firmware. Please update the firmware. Print cancelled.''<br />
<br />
===== M862.5: Gcode level =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnnn</code> nnnn = Gcode level<br />
:<code>Q</code> Current Gcode level<br />
<br />
When run with P<> argument, the check is performed against the input value.<br />
When run with Q argument, the current value is shown.<br />
<br />
;Example messages<br />
:<code>warn</code> ''G-code sliced for a different level. Continue?''<br />
:<code>strict</code> ''G-code sliced for a different level. Please re-slice the model again. Print cancelled.''<br />
<br />
==== M876: Dialog handling ====<br />
<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> signal support for dialog creation on the host = 1, disable = 0<br />
:<code>Snnn</code> select dialog option nnn (0 based)<br />
;Example<br />
M876 P1<br />
M876 S1<br />
<br />
<code>M876 S<n></code> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see [[G-code#Action_commands]]. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.<br />
<br />
Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")<br />
<br />
<<< //action:prompt_begin Filament runout detected. Please choose how to proceed:<br />
<<< //action:prompt_choice Swap filament<br />
<<< //action:prompt_choice Home X/Y and pause print<br />
<<< //action:prompt_choice Abort print<br />
<<< //action:prompt_show<br />
>>> M876 S1<br />
<br />
To indicate the availability of this function, <code>M115</code> will add an extra line:<br />
<br />
Cap:PROMPT_SUPPORT:1<br />
<br />
so hosts know about the presence of the function.<br />
<br />
==== M890 Run User Gcode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{no}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> select 1 - 5 User Gcode defined in configuration.<br />
;Example<br />
M890 S2 ; Start User Gcode 2<br />
<br />
==== M900 Set Linear Advance Scaling Factors ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes|1.1.0}} | prusa={{yes}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|use M572}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
Sets the advance extrusion factors for Linear Advance. If any of the <code>R</code>, <code>W</code>, <code>H</code>, or <code>D</code> parameters are set to zero the ratio will be computed dynamically during printing.<br />
;Parameters<br />
:<code>K[factor]</code> Advance K factor<br />
:<code>R[ratio]</code> Set ratio directly (overrides WH/D)<br />
:<code>W[width]</code> <code>H[height]</code> <code>D[diam]</code> Set ratio from WH/D<br />
;Examples<br />
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio<br />
M900 R0.025 ; Set the WH/D ratio directly<br />
M900 R0 ; Set to "auto ratio"<br />
<br />
Requires enabling the <code>LIN_ADVANCE</code> feature in Marlin 1.1.<br />
<br />
The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:<br />
<br />
K = S * extruder_steps_per_mm<br />
<br />
More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.<br />
<br />
==== M905: Set local date and time ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.16+}} | bfb={{no}} | machinekit={{no}} | makerbot={{no}} | grbl={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Current date in the format YYYY-MM-DD<br />
:<code>Snnn</code> Current time in the format HH:MM:SS<br />
;Example<br />
M905 P2016-10-26 S00:23:12<br />
<br />
Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.<br />
<br />
==== M906: Set motor currents ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie=M907? | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Xnnn</code> X drive motor current<br />
:<code>Ynnn</code> Y drive motor current<br />
:<code>Znnn</code> Z drive motor current<br />
:<code>Ennn</code> E drive(s) motor current(s)<br />
:<code>Innn</code> Motor idle current in percent (0..100)<br />
;Example<br />
M906 X300 Y500 Z200 E350:350<br />
<br />
Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.<br />
<br />
The <code>I</code> parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.<br />
<br />
==== M907: Set digital trimpot motor ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | reprapfirmware={{partial|Use M906}} | smoothie={{yes}} | repetier={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
Set digital trimpot motor current using axis codes (<code>X</code>, <code>Y</code>, <code>Z</code>, <code>E</code>, <code>B</code>, <code>S</code>). In [http://reprap.org/wiki/Repetier Repetier], it sets the current in Percent. In [https://bitbucket.org/intelligentagent/redeem/src/6153607ded91c100fb4e41e936e6d045e19eda29/redeem/gcodes/M907.py?at=slave_stepper Redeem], it sets the current in Amps (whereas <code>M906</code> uses milliamps).<br />
<br />
==== M908: Control digital trimpot directly ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}}<sup>1</sup> | repetier={{yes}}: 0.92 | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
M908 P<pin> S<current><br />
<br />
;Notes<br />
In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.<sup>1</sup><br />
<br />
==== M909: Set microstepping ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{partial|Use M350}} | repetier={{partial|Use M350}} | reprapfirmware={{partial|Use M350}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{partial|Use M350}} }}<br />
<br />
;Example<br />
M909 X3 Y5 Z2 E3<br />
<br />
Set the microstepping value for each of the steppers.<br />
In [[Redeem]] this is implemented as powers of 2 so…<br />
M909 X2 ; set microstepping on X-axis to 2^2 = 4<br />
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.<br />
<br />
==== M910: Set decay mode ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|Use M569}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M910 X3 Y5 Z2 E3<br />
<br />
Set the decay mode for each stepper controller<br />
The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller.<br />
It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the<br />
target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.<br />
<br />
==== M910: TMC2130 init ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M911: Configure auto save on loss of power ("power panic") ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes|1.20+}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Saaa</code> Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.<br />
:<code>Raaa</code> Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.<br />
:<code>P"command string"</code> G-Code commands to run when the print is stopped.<br />
;Example<br />
:M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"<br />
<br />
When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:<br />
<br />
*If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.<br />
*Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.<br />
<br />
M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.<br />
<br />
Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.<br />
<br />
==== M911: Set TMC2130 holding currents ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M917}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M912: Set electronics temperature monitor adjustment ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Temperature monitor channel, default 0<br />
:<code>Snnn</code> Value to be added to the temperature reading in degC<br />
<br />
;Example<br />
M912 P0 S10.5<br />
<br />
Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The <code>S</code> parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.<br />
<br />
==== M912: Set TMC2130 running currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M913: Set motor percentage of normal current ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{yes}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>X, Y, Z, E</code> Percentage of normal current to use for the specified axis or extruder motor(s)<br />
<br />
;Example<br />
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current<br />
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current<br />
<br />
This allows motor currents to be set to a specified percentage of their normal values as set by <code>M906</code>. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use <code>M913</code> again with the appropriate parameters set to 100 to restore the normal currents.<br />
<br />
==== M913: Print TMC2130 currents ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M914: Set/Get Expansion Voltage Level Translator ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | reprapfirmware={{partial|Alligator build only}} | bfb={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>S</code> Expansion voltage signal level, must be 3 or 5<br />
<br />
;Example<br />
M914 S5 ; set expansion signal level to 5V<br />
M913 ; report expansion signal voltage level<br />
<br />
==== M914: Set TMC2130 normal mode ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M915: Configure motor stall detection ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Pnnn:nnn:...''' Drive number(s) to configure<br />
:'''X,Y,Z,U,V,W,A,B,C''' Axes to configure (alternative to using the P parameter)<br />
:'''Snnn''' Stall detection threshold (-64 to +63, values below -10 not recommended)<br />
:'''Fn''' Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)<br />
:'''Hnnn''' (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200<br />
:'''Tnnn''' (optional) Coolstep control register, 16-bit unsigned integer<br />
:'''Rn''' Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file '''/sys/rehome.g''', and resume print<br />
;Examples<br />
:M915 P0:2:3 S10 F1 R0<br />
:M915 X Y S5 R2<br />
<br />
This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).<br />
<br />
If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.<br />
<br />
See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.<br />
<br />
==== M915: Set TMC2130 silent mode ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M569 to select StealthChop mode}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M916: Resume print after power failure ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:none<br />
;Example<br />
:M916<br />
<br />
If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.<br />
<br />
RepRapFirmware also requires macro file '''/sys/resurrect-prologue.g''' to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.<br />
<br />
==== M916: Set TMC2130 Stallguard sensitivity threshold ====<br />
{{Firmware Support | reprapfirmware={{yes|Use M915}} | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M917: Set motor standstill current reduction ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''X,Y,Z,E''' Percentage of normal current to use when the motor is standing still or moving slowly, default 100<br />
;Example<br />
:M917 X70 Y70 Z80 E70:70<br />
<br />
Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.<br />
<br />
Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.<br />
<br />
==== M917: Set TMC2130 PWM amplitude offset (pwm_ampl) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M918: Configure direct-connect display ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|1.21+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.<br />
<br />
;Parameters<br />
:'''P''' Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller<br />
:'''E''' The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.<br />
;Example<br />
:M918 P1 E2<br />
<br />
==== M918: Set TMC2130 PWM amplitude gradient (pwm_grad) ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.<br />
<br />
==== M928: Start SD logging ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M928 filename.g<br />
<br />
Stop SD logging with <code>M29</code>.<br />
<br />
==== M929: Start/stop event logging to SD card ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{yes}} | repetier={{no}} | reprapfirmware={{yes|1.20+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''P"filename"''' The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.<br />
:'''Sn''' S1 = start logging, S0 = stop logging<br />
;Example<br />
:M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt<br />
:M929 S0 ; stop logging<br />
<br />
When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.<br />
<br />
==== M950: Create heater, fan or GPIO/servo device ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Hnn''' Heater number<br />
:'''Fnn''' Fan number<br />
:'''Pnn or Snn''' GPIO or Servo number (the only difference is the default PWM frequency)<br />
:'''C"name"''' Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.<br />
:'''Qnn''' PWM frequency in Hz (optional)<br />
:'''Tnn''' Temperature sensor number, required only when creating a heater.<br />
<br />
;Examples<br />
:M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1<br />
:M950 H2 C"nil" ; disable heater 2 and free up the associated pin<br />
:M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2<br />
:M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz<br />
:M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector<br />
:M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled<br />
<br />
M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.<br />
<br />
If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.<br />
<br />
When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.<br />
<br />
==== M951: Set height following mode parameters ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters:<br />
:'''Snn or Hnn''' Sensor number<br />
:'''Pnn.n''' Proportional factor, in mm per sensor unit<br />
:'''Inn.n''' Integral factor, in mm per sensor unit per second<br />
:'''Dnn.n''' Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)<br />
:'''Fnn.n''' (optional) Sample and correction frequency (Hz), default 5Hz<br />
:'''Znn.n:nn.n''' Minimum and maximum permitted Z values<br />
<br />
Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.<br />
<br />
If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.<br />
<br />
==== M952: Set CAN expansion board address and/or normal data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Bn''' Existing CAN address of expansion board to be changed, 1 to 125.<br />
:'''An''' New CAN address of that expansion board, 1 to 125.<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000)<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
;Example<br />
:M952 B120 A11 ; change the CAN address of expansion board 101 to 11<br />
:M952 B11 S500 ; change the CAN bit rate or expansion board 11 to 500kbps<br />
<br />
Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.<br />
<br />
This command can also be used to change the normal data rate, for example if the printer has CAN bus cables that are too long to support the standard data rate (1Mbits/sec in RepRapFirmware). All boards in the system on the same CAN bus must use the same CAN data rate. The procedure for changing the data rate is:<br />
* Use M952 to change the data rate on all the expansion boards, one at a time. After changing the data rate on each expansion board, you will no longer be able to communicate with it, and you may need to power it down or disconnect it from the CAN bus to prevent it interfering with subsequent CAN communications.<br />
* Change the data rate of the main board last. Then the main board should be able to communicate with all the expansion boards again.<br />
<br />
==== M953: Set CAN-FD bus fast data rate ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{yes|3.0+}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:'''Sn.n''' Requested bit rate in Kbits/second (1K = 1000). Ignored if it is lower than the bit rate for the negotiation phase.<br />
:'''T0.n''' Fraction of the bit time between the bit start and the sample point (optional)<br />
:'''J0.n''' Maximum jump time as a fraction of the bit time (optional)<br />
:'''Caa:bb''' Transceiver delay compensation offset and minimum, in nanoseconds (optional)<br />
;Example<br />
:M953 S4000 T0.6 J0.2<br />
<br />
This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets using the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.<br />
<br />
The optional C parameter allows fine-tuning of the transmitter delay compensation. The first parameter is the offset added to the measured transmitter delay. The optional second value, which must be greater than the first, is the minimum delay compensation applied. Glitches see by the receiver while the transceiver delay is being measured will be ignored if they would result in a transceiver delay compensation lower than this value. When CAN is implemented on Microchip SAME5x and SAMC21 processors, these values are converted from nanoseconds into time quanta and stored in the TDCO and TDCF fields of the transceiver delay compensation register.<br />
<br />
==== M995: Calibrate Touch Screen ====<br />
{{Firmware Support | grbl={{no}} | fived={{no}} | teacup={{no}} | makerbot={{no}} | redeem={{no}} | sprinter={{no}} | marlin={{yes|2.0.6+}} | prusa={{no}} | repetier={{no}} | reprapfirmware={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | mk4duo={{no}} | klipper={{no}} | yaskawa={{no}} }}<br />
<br />
==== M997: Perform in-application firmware update ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} | makerbot={{no}} | redeem={{no}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:<code>Snnn</code> Firmware module number(s), default 0<br />
:<code>Bnnn</code> Expansion board address, default 0 (i.e. main controller board)<br />
;Example<br />
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board<br />
M997 B3 ; update firmware module 0 on the expansion board with address 3<br />
<br />
This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:<br />
<br />
0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.<br />
<br />
1 - web server firmware, filename sys/DuetWiFiServer.bin<br />
<br />
2 - (Duet WiFi running RepRapFirmware 1.18 and earlier only) web server file system, filename sys/DuetWebControl.bin <br />
<br />
3 - put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port<br />
<br />
==== M998: Request resend of line ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | repetier={{no}} | smoothie={{no}} | bfb={{no}} | machinekit={{no}} | reprapfirmware={{yes}} }}<br />
<br />
;Parameters<br />
:<code>Pnnn</code> Line number<br />
;Example<br />
M998 P34<br />
<br />
Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.<br />
<br />
==== M999: Restart after being stopped by error ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{yes}} | prusa={{no}} | repetier={{no}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{no}} | mk4duo={{yes}} | yaskawa={{no}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code> Reset flags<sup>1</sup><br />
;Example<br />
M999<br />
<br />
Restarts the firmware using a software reset.<br />
<br />
;Notes<br />
<br />
<sup>1</sup>The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.<br />
<br />
== Other commands ==<br />
<br />
==== G: List all G-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
G<br />
<br />
Print a list of all implemented G-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposal.)<br />
<br />
==== M: List all M-codes ====<br />
{{Firmware Support | fived={{no}} | teacup={{no}} | sprinter={{no}} | marlin={{no}} | prusa={{no}} | smoothie={{no}} | repetier={{no}} | reprapfirmware={{no}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{no}} | yaskawa={{no}} }}<br />
<br />
;Example<br />
M<br />
<br />
Print a list of all implemented M-codes in the firmware with description to the host.<br><br />
(Note: this has been implemented in [[Redeem]], and so is only a proposition)<br />
<br />
==== T: Select Tool ====<br />
{{Firmware Support | fived={{yes}} | teacup={{yes}} | sprinter={{no}} | marlin={{yes}} | prusa={{yes}} | repetier={{yes}} | smoothie={{yes}} | reprapfirmware={{yes}} | bfb={{no}} | grbl={{no}} | makerbot={{no}} | machinekit={{no}} | redeem={{yes}} | mk4duo={{yes}} | yaskawa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters.''<br />
:<code>Pnnn</code>: Bitmap of all the macros to be run (only RRF 1.17b or later)<br />
:Tool number<br />
;Example<br />
T1<br />
<br />
Select tool (or in older implementations extruder) number 1 to build with.<br />
<br />
The sequence followed is:<br />
<br />
# Set the current tool to its standby temperatures specified by <code>G10</code> (see above),<br />
# Set the new tool to its operating temperatures specified by <code>G10</code> and wait for '''all''' temperatures to stabilise,<br />
# Apply any X, Y, Z offset for the new tool specified by <code>G10</code>,<br />
# Use the new tool.<br />
<br />
Selecting a non-existent tool (100, say) just does Step 1 above<sup>1</sup>. That is to say it leaves all tools in their standby state. You can, of course, use the <code>G10</code> command beforehand to set that standby temperature to anything you like.<br />
<br />
Note that you may wish to move to a parking position ''before'' executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.<br />
<br />
If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.<br />
<br />
Some firmware (Such as Prusa i3 Printers with MMU) also support the <code>Tx</code> (recommended) and <code>T?</code>(depricated)<sup>2</sup> commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the <code>Tc</code> command actually loads the selected filament.<br />
<br />
Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros<sup>3</sup>. There are normally three specified (any of which can contain no commands if desired) that execute in this order:<br />
<br />
# Actions to do with the old tool before it is released - macro name: <code>tfreeN.g</code> where N is the tool number;<br />
# (Old tool is released);<br />
# Actions to do with the new tool before it is selected - macro name: <code>tpreN.g</code> where N is the tool number;<br />
# (New tool is selected); and<br />
# Actions to do with the new tool after it is selected - macro name: <code>tpostN.g</code> where N is the tool number.<br />
<br />
With such implementations there is no wait for temperature stabilisation. That can be achieved by an <code>M116</code> in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.<br />
<br />
After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The <code>M0</code>, <code>M1</code>, and <code>M112</code> commands turn them all off. You can, of course, turn them all off with the <code>M1</code> command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.<br />
<br />
Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the <code>M563</code> command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.<br />
<br />
;Notes<br />
<sup>1</sup> For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.<br />
<br />
<sup>2</sup> <code>T?</code> was the original form of the command, but it was changed to <code>Tx</code> when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.<br />
<br />
<sup>3</sup> Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional <code>P</code> parameter to specify which macros shall be run. If it is abscent then all of the macros above will be run, else you can pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.<br />
<br />
==== D: Debug codes ====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
Debug codes are not active by defalut and must be defined in source code.<br />
<br />
===== D-1: Endless Loop =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''---''<br />
<br />
===== D0: Reset =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will reset the board''<br />
:<code>B</code>: Bootloader<br />
<br />
===== D1: Clear EEPROM and RESET =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will clear the EEPROM and reset the board''<br />
<br />
===== D2: Read/Write RAM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire RAM.''<br />
:<code>Annnn</code>: Address (x0000-x1fff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D3: Read/Write EEPROM =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the entire EEPROM.''<br />
:<code>Annnn</code>: Address (x0000-x0fff)<br />
:<code>Cnnnn</code>: Count (1-4096)<br />
:<code>Xnnnn</code>: Data (hex)<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D4: Read/Write PIN =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''To read the digital value of a pin you need only to define the pin number.''<br />
;Parameters<br />
:<code>Pnnn</code>: Pin (0-255)<br />
:<code>Fn</code>: Function in/out (0/1)<br />
:<code>Vn</code>: Value (0/1)<br />
<br />
===== D5: Read/Write FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:''This command can be used without any additional parameters. It will read the 1kb FLASH.''<br />
:<code>Annnn</code>: Address (x00000-x3ffff)<br />
:<code>Cnnnn</code>: Count (1-8192)<br />
:<code>Xnnnn</code>: Data (hex)<br />
:<code>E</code>: Erase<br />
<br />
;Notes<br />
: The hex address needs to be lowercase without the 0 before the x<br />
: Count is decimal<br />
: The hex data needs to be lowercase<br />
<br />
===== D6: Read/Write external FLASH =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D7: Read/Write Bootloader =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D8: Read/Write PINDA =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>?</code>: Read PINDA temperature shift values<br />
:<code>!</code>: Reset PINDA temperature shift values to default<br />
:<code>Pnnn</code>: Pinda temperature [C]<br />
:<code>Znnnn</code>: Z Offset [mm]<br />
<br />
===== D9: Read/Write ADC =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
;Parameters<br />
:<code>I(index)</code>: ADC channel index<br />
:<code>I0</code>: Heater 0 temperature<br />
:<code>I1</code>: Heater 1 temperature<br />
:<code>I2</code>: Bed temperature<br />
:<code>I3</code>: PINDA temperature<br />
:<code>I4</code>: PWR voltage<br />
:<code>I5</code>: Ambient temperature<br />
:<code>I6</code>: BED voltage<br />
:<code>V</code>: Value to be written as simulated<br />
<br />
===== D10: Set XYZ calibration = OK =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D12: Time =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''Writes current time in the log file.''<br />
<br />
===== D80: Bed check =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "mesh.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D81: Bed analysis =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
:''This command will log data to SD card file "wldsd.txt".''<br />
<br />
;Parameters<br />
:<code>E</code>: Dimension X (default 40)<br />
:<code>F</code>: Dimension Y (default 40)<br />
:<code>G</code>: Points X (default 40)<br />
:<code>H</code>: Points Y (default 40)<br />
:<code>I</code>: Offset X (default 74)<br />
:<code>J</code>: Offset Y (default 34)<br />
<br />
===== D106: Print measured fan speed for different pwm values =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
<br />
===== D2130: Trinamic stepper controller =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:Reserved<br />
<br />
===== D9125: PAT9125 filament sensor =====<br />
{{Firmware Support | prusa={{yes}} }}<br />
:''This command can be used without any additional parameters. It will read the PAT9125 values.''<br />
;Parameters<br />
:<code>?</code>: Print values<br />
:<code>!</code>: Print values<br />
:<code>R</code>: Resolution. Not active in code<br />
:<code>X</code>: X values<br />
:<code>Y</code>: Y values<br />
:<code>L</code>: Activate filament sensor log<br />
<br />
== Proposed EEPROM configuration codes ==<br />
<br />
BRIEFLY: each RepRap has a number of physical parameters that should be persistent, but easily configurable, such as extrusion steps/mm, various max values, etc. Those parameters are currently hardcoded in the firmware, so that a user has to modify, recompile and re-flash the firmware for any adjustments. These configs can be stored in MCU's EEPROM and modified via some M-codes. Please see the detailed proposal at [[M-codes for EEPROM config]]. (''This is proposed by --[[User:AlexRa|AlexRa]] on 11-March-2011. There is currently no working implementation of the proposed commands'').<br />
<br />
[[Marlin]] uses codes <code>M500</code>-<code>M503</code> to manipulate EEPROM values.<br />
<br />
[[RepRapFirmware]] uses the config-override.g file on the SD card instead of EEPROM. M500 saves certain values to that file, M501 re-loads them, and M502 loads the values from config.g, ignoring config-override.g.<br />
<br />
[[Sprinter]] has implemented the following commands to manipulate EEPROM [https://github.com/kliment/Sprinter/commit/4b1b0f1d96d2be2ed3941095f40a5c2d2bbb943d Commit message].<br />
<br />
[[Teacup]] uses codes <code>M130</code>-<code>M136</code> to set, read, and save some parameters.<br />
<br />
== Replies from the RepRap machine to the host computer ==<br />
<br />
All communication is in printable ASCII characters. <br />
<br />
Messages sent back to the host computer are terminated by a newline.<br />
<br />
The basic protocol responses look like this:<br />
<br />
'''xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]'''<br />
<br />
<code>xx</code> can be one of:<br />
<br />
* <code>ok</code> - The RepRap machine is ready to receive the next line from the host.<br />
* <code>rs</code> or <code>Resend</code> - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as <code>N<linenumber></code> or <code>N:<linenumber></code>. Examples: <code>Resend: 123</code>, <code>Resend: N123</code>, <code>rs:123</code><br />
* <code><nowiki>!!</nowiki></code> or <code>Error:</code> or <code>fatal:</code> (Repetier Firmware) - There was an error. Common communication errors such as <code>checksum mismatch, Last Line: <number></code> or <code>Wrong checksum</code>, <code>No Checksum with line number, Last Line: <number></code> or <code>Missing checksum</code>, <code>Line Number is not Last Line Number+1, Last Line: <number></code> or <code>expected line <number1> got <number2></code> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include <code>Unknown command: "<command>"</code> and several SD related errors such as <code>Cannot open subdir <dir></code>, <code>SD init fail</code>, <code>volume.init failed</code>, <code>openRoot failed</code>, <code>workDir open failed</code>, <code>open failed, File: <name></code>, <code>error writing to file</code>, <code>Cannot enter subdir: <dir></code> and <code>SD read error</code>. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.<br />
* <code>wait</code> - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.<br />
* <code>busy:<reason></code> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), <code>paused for user</code> (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), <code>paused for input</code> (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: <code>busy: processing</code>, <code>busy: paused for user</code>.<br />
<br />
The '''T:''' and '''B:''' values are the temperature of the currently-selected extruder<br />
and the bed respectively, and are only sent in response to <code>M105</code>. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273<sup>o</sup>C) is returned.<br />
<br />
'''C:''' means that coordinates follow. Those are the '''X: Y:''' etc values. These are only<br />
sent in response to <code>M114</code> and <code>M117</code>.<br />
<br />
The RepRap machine may also send lines that look like this:<br />
<br />
'''// This is some debugging or other information on a line on its own. It may be sent at any time. '''<br />
<br />
Such lines will always be preceded by '''//'''.<br />
<br />
The most common response is simply:<br />
<br />
<code>ok</code><br />
<br />
When the machine boots up it sends the string<br />
<br />
<code>start</code><br />
<br />
once to the host before sending anything else. This should not be replaced or augmented<br />
by version numbers and the like. <code>M115</code> (see above) requests those.<br />
<br />
Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of <code>ok</code>, <code>rs</code>, <code><nowiki>!!</nowiki></code> or <code>//</code>). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.<br />
<br />
=== Example of a communication error with resend request ===<br />
<br />
<code>>>></code> are lines sent from the host to the RepRap machine, <code><<<</code> are lines sent from the RepRap machine to the host.<br />
<br />
>>> N66555 G1 X131.338 Y133.349 E0.0091*91<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< Error:checksum mismatch, Last Line: 66555<br />
<<< Resend: 66556<br />
<<< ok<br />
>>> N66556 G1 X131.574 Y133.428 E0.0046*92<br />
<<< ok<br />
<br />
=== Action commands ===<br />
<br />
On the current versions of Pronterface and OctoPrint a special comment of the form:<br />
<br />
'''// action:<command>'''<br />
<br />
is allowed to be sent from the firmware.<br />
<br />
As this is also a comment other hosts will just ignore these commands.<br />
<br />
Supported commands currently are:<br />
<br />
* '''pause''': Instructs the host to pause the print job<br />
* '''resume''': Instructs the host to resume the print job<br />
* '''disconnect''': Instructs the host to disconnect from the printer<br />
* '''cancel''': Instructs the host to abort the current job<br />
* '''out_of_filament T<extruder_id>''': Tells host that filament for extruder extruder_id is run out or jammed. Host should issue a pause and can offer better help to user with this. For backward compatibility it should be followed by the pause action.<br />
<br />
Additional commands supported by a subset of hosts:<br />
<br />
* '''paused''': Instructs the host that a print job under control of the printer was paused. (support: OctoPrint 1.3.9+)<br />
* '''resumed''': Instructs the host that a print job under control of the printer was resumed. (support: OctoPrint 1.3.9+)<br />
* '''prompt_begin <message>''': Starts the definition of a prompt dialog. '''<message>''' is the message to display to the user. (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)<br />
* '''prompt_choice <text>''': Defines a dialog choice with the associated '''<text>'''. (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)<br />
* '''prompt_button <text>''': Same as '''prompt_choice'''. (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)<br />
* '''prompt_show''': Tells the host to prompt the user with the defined dialog. (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)<br />
* '''prompt_end''': Tells the host to close the dialog (e.g. the user made the choice through the printer directly instead of through the host). (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)<br />
* '''probe_rewipe''': Displays dialog indicating G29 Probing is Retrying. (support: Lulzbot Cura 3.6+)<br />
* '''probe_failed''': Cancels print job and displays dialog indicating G29 Probing failed (support: Lulzbot Cura 3.6+)<br />
<br />
A host can select a dialog option and finish the dialog via M876 Snnn: [[G-Code#M876:_Dialog_handling]]. It can signal support for dialogs via M876 P1.<br />
<br />
For a more detailed example of the dialog functionality enabled through the '''prompt_*''' set of action commands, see [http://docs.octoprint.org/en/master/bundledplugins/action_command_prompt.html OctoPrint's documentation].<br />
<br />
=== Further notes ===<br />
<br />
1. Marlin 1.0.0 Gen6 Firmware does not follow the two character rule. 'rs' is actually 'Resend' and '!!' is 'Error'.<br />
Example Lines:<br />
* Error: Line Number is not current line + 1. Last Line: 7<br />
* Resend: 8<br />
* Writing to File: print.gco<br />
* Done saving file.<br />
* File opened:print.gco Size:22992<br />
* File selected<br />
<br />
When in the code base did this change take place and what other firmwares are affected?<br />
<br />
2. RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:<br />
* <code>M105 S2</code> (now deprecated in favour of M408)<br />
* <code>M105 S3</code> (now deprecated in favour of M408)<br />
* <code>M20 S2</code><br />
* <code>M36</code><br />
* <code>M408</code><br />
<br />
== Proposal for sending multiple lines of G-code ==<br />
<br />
So far, this is a proposal, open for discussion.<br />
<br />
==== Problem to solve ====<br />
<br />
When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an <code>ok</code> before the next line can be sent without locking communications up. This slows down communication and limits the number of commands that can be sent per second to the printer controller, as the USB stack on the host and the serial interface driver on the Arduino add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured so as not to wait for the <code>ok</code>.<br />
<br />
For more details on this proposal, some suggested solutions and comments, please see [[GCODE_buffer_multiline_proposal]]<br />
<br />
== Alternatives to G-code ==<br />
:''Main article: [[Firmware/Alternative#alternatives to G-code]]''<br />
<br />
Several people have suggested using STEP-NC or some other control language;<br />
or perhaps designing a completely new control language.<br />
<br />
[[Category:G-code| ]]<br />
[[Category:Firmware]]<br />
[[Category:Software]]<br />
[[Category:Reference]]</div>Espr14