G-code/ja

From RepRap
Jump to: navigation, search

このページは現在再翻訳中です。非常にデータが古いため、ベーシックなコード以外は 英語版 を確認するようにして下さい。

このページでは、RepRap の様々なファームウェアで使用されているGコードと、その働きを説明します。主となる目的は FFF 方式を使った積層造形です。プリントヘッドの移動に使われるコードは NIST により RS274NGC Gコード スタンダード に準拠しています。したがって、RepRapファームウェアはCNCミリングマシンなどの用途に対しても、非常に有用なものとなっています。Wikipedia の Gコードの記事 (英語) もご参照ください。

3Dプリンターへ使うGコードの準備方法には、いくつかの異なる方法があります。1つは Slic3rSkeinforgeCura などの スライスプログラムを使う方法です。これらのプログラムでは、インポートされたCADモデルをレイヤー状にスライスし、それぞれのレイヤーで必要なGコードを出力します。スライサープログラムは、3Dモデルをプリント部品へと変えるのにもっとも簡単な方法ですが、柔軟性に問題を抱えることもあります。Gコードを生成するほかの方法としては、Mecode のような低級ライブラリを使う方法があります。これらのライブラリーでは、ツールパスによって精密なコントロールを行うため、通常のスライスプログラムには適さない、複雑なプリントを行うときには非常に便利です。また、当然ながら、Gコードを自分で書いて3Dプリンターを制御することもできます。この方法は、プリンターの調整時などに、数本の線だけを出力したい、などというときには最も良い手段と言えるでしょう。

世界中には、たくさんの異なるファームウェアが存在します。その開発者たちは議論を交わしたり、誰かがしたことを調べずに新しい機能を実装してしまう傾向にあるため、長年にわたって開発されてきた3Dプリンター固有のコードには、たくさんの意味が持たされてしまっていることがあります。このページは、RepRapのマスターページです。このページの情報にしたがって全てのファームウェアがつくられていれば、同じコードを2つの異なる目的に使われることはなくなるはずです。したがって、新しい機能を開発するのであれば、まずここにコードを追加すればよいのです。とにかく、新しいコードは、このページに追加してから、実装してください。

ただ、残念なことに、人間の本質は変わりません。ベストと考えられる手順が、必ずしも従われるとは言い切れません。そのため、複数の機能がもたされるコードがいくつか出現してしまうことでしょう。もしそのようなことがあっても、このページに既に記載があり、その後から追加されたコードは、基本的には廃止されるか、変更される必要がある、というルールがあることを覚えておいてください。もちろん、後のインスタンスが優先される、技術的に素晴らしい理由があるという際には例外となります。実装日よりも、ここに追加された日の方が重要であることを覚えておいてください。

Contents

はじめに

通常、RepRapマシンに送信されるGコードは以下のようなものです。

 N3 T0*57
 N4 G92 E0*67
 N5 G28*22
 N6 G1 F1500.0*82
 N7 G1 X2.0 Y2.0 F3000.0*85
 N8 G1 X3.0 Y3.0*33

Gコードは、SDカード上のファイルにも保存することができます。RepRapのGコードを含んでいるファイルには、通常、.g.gco.gcodeなどの拡張子が与えられています。BFB/RapManへのファイルには、.bfbが使われています。ファイルに保存されているものや、スライサーによって生成されたGコードは、以下のようなものとなっているでしょう。

G92 E0
G28
G1 F1500
G1 X2.0 Y2.0 F3000
G1 X3.0 Y3.0

これらの記号や数字、その他のコードの意味は、以下にて説明されています。

スライサーソフトウェアは、Gコードファイルの最初と最後の行に、プリントの前後に行う特殊な操作を行うためのコードを追加します。(オプションとされているものもあります。) 特殊な操作の例としては、オートレベリング、ヒートベッドやホットエンドの加熱/冷却、ウージング(oozing) によるフィラメント切れを防ぐためのノズルの清掃機能、スタートアップ動作、システム電源の ON/OFF、部品の排出機能などが挙げられます。より詳細な情報は、Start GCode routinesEnd GCode routines ページをご覧ください。

特定のGコードが、どのファームウェアで実装されているのかを確認しやすくするため、コマンドの説明欄には以下のような表が設けられています。

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
Yes Automatic No Partial Experimental Deprecated ??? ??? ??? ??? Yes Partial

それぞれのフィールドの意味は以下の通りです。

Yes

全ての機能をサポートしていることを表します。

Partial または Experimental

部分的に機能をサポートしていることを表します。
この場合には、ファームウェアのソースコードをそれぞれのブランチから確認したり、メインボードに設定されているスイッチを切り替える必要があったりします。
Automatic
この機能はファームウェアが自動的に処理することを表しています。したがって、このコマンドを送信する必要はありません。
例えば、Teacupファームウェアでの電源の on/off(M80/M81) に関するGコードがこれに相当します。
???
ファームウェアがこのGコードをサポートしているかが不明なことを表します。
もしあなたがプリンターを販売する予定があるのであれば、生産する前にこの機能をテストする必要があります。

No

ファームウェアがこの機能をサポートしていないことを表します。
Deprecated
ファームウェアがこのGコードを廃止したことを表します。
ファームウェアの作者は、Gコードを廃止する際には、このページ上のGコードに廃止することを記載し、(必要であるならば) 回避策を提示してください。また、そのコードがサポートされていた最後のバージョンも必ず記載してください。

フィールド

RepRap の Gコードはスペースや改行などで区切られる、フィールドの数々によって構成されています。これらのフィールドは、コマンドやパラメータ、その他の特別な目的として、ファームウェアによって識別されます。フィールドは、直後に数字が続く1文字の特定の文字や、数字を持たない1文字(フラグ) によって構成されます。フィールドの文字にはそれぞれ意味があり、それらはこの節の末尾にあるリストから確認できます。数字は、状況に応じて 整数 (例: 128) または 小数 (例: 12.42) で指定されます。例えば、X軸座標には 整数 である X175 や、少数である X17.62 などを割り当てることができます。しかし、エクストルーダー番号などに 2.76 などといった小数が使われないことは明らかです。このページでは、フィールドの数字は nnn というプレースホルダーによって表されます。

RepRapFirmwareでは、複数の数値をパラメーターとして割り当てることのできるコマンドがいくつか存在します。この場合、数値の区切りとしてコロンを使用します。通常、これはマルチエクストルーダー環境において、エクストルーダーを指定するために使用されます。それぞれのエクストルーダーには特定の数値が与えられており、この値を指定せずに1つの数値のみを入力すると、そのパラメーターにしたがって全てのエクストルーダーが動作します。

文字 意味
Gnnn ある点に移動させるなどの、Gコードにおけるスタンダードなコマンドです。
Mnnn 冷却ファンを起動するなどの、RepRap が独自に定義したコマンドです。
Tnnn nnnの番号のツールを選択します。RepRapでは通常、この"ツール"は一つまたは複数のエクストルーダーに取り付けられたノズルを意味します。
Snnn パラメータを指定するコマンドです。秒で指定される時間や、温度、モーターにかける電圧などに使われています。
Pnnn パラメータを指定するコマンドです。ミリ秒で指定される時間や、PIDチューニング における比例定数 (Kp) などに使われています。
Xnnn X軸座標コマンドです。通常は移動先を指定するために使われます。数値は整数でも少数でも構いません。
Ynnn Y軸座標コマンドです。通常は移動先を指定するために使われます。数値は整数でも少数でも構いません。
Znnn Z軸座標コマンドです。通常は移動先を指定するために使われます。数値は整数でも少数でも構いません。
U,V,W さらなる軸に向けての座標コマンドです。(RepRapFirmware)
Innn パラメータを指定するコマンドです。円弧移動時の X-オフセットや、PIDチューニング における時間積分の誤差の変化率 (Ki) などに使われています。
Jnnn パラメータを指定するコマンドです。円弧移動時の Y-オフセットなどに使われています。
Dnnn パラメータを指定するコマンドです。PIDチューニング における直径や、導関数 (Kd) などに使われています。
Hnnn パラメータを指定するコマンドです。PIDチューニング において、ヒーター番号として使われています。
Fnnn 1分間あたりのフィードレートです。mmで指定します。(プリントヘッドの移動速度)。
Rnnn パラメータを指定するコマンドです。温度を指定するために使用されています。
Qnnn パラメータを指定するコマンドです。現在は使用されていません。
Ennn 押し出されるフィラメントの長さ (mm) です。X,Y,Zと同様に指定しますが、消費されるフィラメントの長さが指定されます。
Nnnn ライン番号です。通信エラーが起きたときに再送信を要求するために使われます。
*nnn チェックサムです。通信エラーをチェックするために使用されます。

大文字/小文字の区別

NISTによるオリジナルのGコードスタンダードでは、Gコードを扱うプログラムに対し、大文字/小文字の区別をつけないことを要求しています。(コメント内の文字は除く) しかしながら、全ての3Dプリンターのファームウェアがこれに準拠しているわけではなく、大文字で書かれたコマンド文や変数のみしか認識しないものもあります。

大文字/小文字の区別を要求しないことで知られるファームウェア
RepRapFirmware version 1.19 とそれ以降 (引用文を除く)
大文字/小文字の区別を要求することで知られるファームウェア
RepRapFirmware version 1.18 とそれ以前

引用文

RepRapFirmwareでは、いくつかのコマンドが 引用文 をサポートしています。これを使うと、スペースやセミコロンなどの通常は使用することのできない文字を、ファイル名やWiFiパスワードなどに変数として使用することができます。引用文は、ダブルクオーテーション " によって区切られます。引用文中にダブルクオーテーションを使う必要がある場合には、ダブルクオーテーションを二度入力してください。

使用例

ここでは、MYROUTER というSSIDと、ABCxyz;" 123 というパスワードをWiFiネットワークリストに追加する例を示します。

この場合には、以下のようなコマンドを入力します。

M587 S"MYROUTER" P"ABCxyz;"" 123"

もし小文字を使えないファームウェアを使っている場合には、以下のコマンドを入力します。

M587 S"MYROUTER" P"ABC'X'Y'Z;"" 123"

コメント

Gコードのコメントは、セミコロン (;) から始まり、改行コードで終わります。

N3 T0*57 ; これがコメントです
N4 G92 E0*67
; これもまたコメントとして使えます
N5 G28*22

いくつかのファームウェアでは、CNC Gコードスタンダードに準拠し、コメントを括弧で区切っていることがあります。この場合には、括弧は同じ行内に収まっている必要があります。

(軸のホーミング)
G28 (ホーミングされる軸) X Y

RepRapプリンターでは、コメントやスペースは無視されます。ただし、これらはプリンターに送られる前にホストコンピューターによって取り除かれる方がよいでしょう。これにより、通信量を削減することができます。

特別なフィールド

N: 行番号

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
Yes Yes Yes Yes ??? ??? Yes Yes ??? ??? Yes Yes
N123

行番号が存在する場合、それは行の最初のフィールドでなければなりません。SDカードに保存されるGコードファイルでは、通常行番号は省略されています。

チェック機能がサポートされている場合、RepRap ファームウェアは、行番号が1行につき1ずつ増えることを予測します。この通りにならなかった場合には、エラーとしてフラグが立てられます。しかし、M110コマンド (以下を参照) を使うことでカウントをリセットすることができます。

Machinekitにおいては、Nを使用することには意味がなく、サポートはされていますが、推奨されません。

*: チェックサム

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
Yes Yes Yes Yes ??? ??? Yes ??? ??? ??? No Yes
*71

チェックサムが存在する場合、それは行の最後のフィールドでなければなりません。ただし、コメント文よりは先である必要があります。SDカードに保存されるGコードファイルでは、通常チェックサムは省略されています。

ファームウェアはチェックサムとローカルで計算された値を比較します。これらが異なる場合には、その行を再送信するよう要求します。

チェック機能

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
Yes Yes Yes Yes Yes ??? Yes ??? ??? ??? No Yes
N123 [...ここにGコードが書かれます...] *71

RepRapファームウェアは行番号とチェックサムをチェックします。 これらを指定せずにコマンドを送ってもRepRapは動作しますが、チェックは行われません。これらは両方とも指定されているか、指定されていないかのどちらかである必要があります。 もし片方のみが存在している場合には、エラーとなります。

Gコード文字列 "cmd" (行番号も含む) のチェックサム "cs" は、以下のように、それぞれのバイトで排他的論理和計算が行われます。* や NULL文字 と一致すると、処理が終了します。

int cs = 0;
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)
   cs = cs ^ cmd[i];
cs &= 0xff;  // 防御的プログラミング

そして計算によって求められた値は、10進数の整数として、コマンドの* の後に追加されます。

バッファリング

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
Yes Yes ??? Yes ??? ??? Yes ??? ??? Yes Yes Yes

バッファリングがサポートされている場合には、RepRapファームウェアは、いくつかのコマンドを内部リングバッファに保存してから実行します。これはつまり、コマンドが確認され、次のコマンドが送信されるまでの間に (明確な) 遅延がなくなることを意味します。また、線分シーケンスが、それぞれの間を遅延なくプロットされるようになることを意味しています。バッファリングコマンドが受信されるとすぐに、これらは確認作業が行われ、ローカルに格納されます。ローカルバッファーが全て埋まってしまった場合、次のバッファーが利用できるストレージスペースができるまで、確認作業が遅延されます。これは フロー制御 の仕組みと同じです。

通常、次のような移動コマンドはバッファリングされます: G0-G3G28-G32 Teacup Firmware では、さらに他の設定コマンドもバッファリングします: G20, G21, G90, G91 これ以外の G, M, T コマンドについては、バッファリングされません。

特定のコード (M106 など) が正しい順序で実行されることを保証し、既に実行された移動コマンドがより前方のキューに追加されないようにするために、RepRapFirmware では、さらに内部キューを実装しています。

バッファリングされないコマンドは、受信される、バッファに格納されますが、バッファ内のその他のコマンドが全て実行されるまで、ホストに認識されません。したがって、これらのコマンド送る際には、ホストはそのコマンドが完了されるまで一時停止します。これらのコマンド間で行われる短いポーズは、マシンのパフォーマンスには影響しません。

Gコマンド

G0 & G1: 移動

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
  • G0 : 高速直線移動
  • G1 : 直線移動
使用方法
G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn
G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn
パラメータ
全てのパラメータを指定する必要はありませんが、最低でも一つのパラメータは指定する必要があります。
Xnnn X軸上における移動先の位置
Ynnn Y軸上における移動先の位置
Znnn Z軸上における移動先の位置
Ennn 開始地点と終了地点の間で押し出されるフィラメントの量
Fnnn 開始地点と終了地点の間のフィードレート (一分間あたりの値。指定されている場合にのみ適用。)
Snnn エンドストップに到達したことをチェックするフラグ (S1 でチェック、S0 で無視。S2 は後述の注意点を参照。デフォルトは S0 です。)1
G0 X12               ; X軸上の 12mm の位置に移動する
G0 F1500             ; フィードレートを 1500mm/分 に設定する
G1 X90.6 Y13.8 E22.4 ; 22.4mm のフィラメントを押し出しながら、X軸の 90.6mm、Y軸の 13.8mm の位置に移動する

RepRap Firmware では、G0G1 を同じコマンドとして扱う仕様となっています。これは同じコマンドとして扱わない場合と、効率が全く変わらないためです。2

ほとんどのRepRapファームウェアでは、フィードレートに対しては巧妙な動作を行います。

G1 F1500           ; フィードレートを 1500mm/分 に設定する
G1 X50 Y25.3 E22.4 ; 移動しながら、フィラメントを押し出す

上記の例では、先に 1500mm/分 のフィードレートに設定してから、2点間の間で 22.4mm のフィラメントを押し出しながら、X軸の 50mm、Y軸の 25.3mm に移動します。

G1 F1500                 ; フィードレートを 1500mm/分 に設定する
G1 X50 Y25.3 E22.4 F3000 ; 3000mm/分 まで加速する

対して、上記の例では、1500mm/分 のフィードレートに設定してから、同様に移動する点は同じですが、こちらの例では、3000 mm/m まで加速させます。全ての動作は同期しているので、X軸やY軸の動きに合わせて、フィラメントの押し出される量も加速します。

RepRapの仕様では、フィードレートは他のパラメータと同様、直線補間される変数として扱われます。これにより、プリントヘッドの加速と減速は、全てがスムーズに動くように完全に制御され、全ての位置で適切な量のフィラメントが出力されるようになります。3

一定の長さでエクストルーダーを巻き戻すには、単純に G0G1 コマンドとともに、既に押し出した長さより短い値の E を送りましょう。(例えば、移動中にノズルが空中に浮いてしまい、そのままでは溶けたフィラメントが垂れてしまうような状況で、内圧を下げるために使われます。)

注意点

1 いくつかのファームウェアでは、移動中のエンドストップ検知機能を有効化または無効化することができるようになっています。正しく設定されていない場合には、RepRapにダメージが及ぼされることがあります。したがって、どのファームウェアを使っている場合でも、この使い方と同様に S パラメーターがサポートされているかどうかを確認してください。RepRapFirmwareでは、デルタプリンターで S1 または S2 パラメータを使うと、XYZ パラメータがヘッドの位置ではなく、それぞれのタワーモーターの位置を参照するようになります。また、パラメータが S1 の場合には、エンドストップの検知機能が有効化されます。

2 RS274NGCの仕様では、G0高速移動 とされています。これは現在の位置から新しい位置へとできる限り速くかつ効率的に移動するために使われていました。また、G1制御移動 とされています。これは同様の移動をできる限り精密に行う目的で使われていました。

3 いくつかのファームウェアでは、移動コマンドと同時にインラインでフィードレートを設定することをサポートしていません。

4 RepRapFirmware では 'R1' という追加コマンドを提供しています。これは、以前にプリントをポーズした座標へ戻ることをマシンに指示するコマンドです。このパラメータが使われている場合で、軸のコマンドも同時に指定されている場合、ポーズした座標にオフセットが追加されます。(例: G1 R1 Z5)

いくつかの古いCNCやその他のマシンでは、直線移動でない場所でより速く移動することが可能となっていました。これは、デルタ型ポーラー型 プリンターなどの、曲面部で直接よりも速く動きやすい、非カーテシアンプリンターにも当てはまります。

G2 & G3: 円弧補間

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
No No Yes Yes1 Yes Yes No Yes ??? Yes Experimental Yes
使用方法
G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn (時計回り円弧補間)
G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn (反時計回り円弧補間)
パラメータ
Xnnn X軸上における移動先の位置
Ynnn Y軸上における移動先の位置
Innn X軸上における円弧中心の位置
Jnnn Y軸上における円弧中心の位置
Ennn 開始地点と終了地点の間で押し出されるフィラメントの量
Fnnn 開始地点と終了地点の間のフィードレート (一分間あたりの値。指定されている場合にのみ適用。)
G2 X90.6 Y13.8 I5 J10 E22.4

(中心点を X=現在のX座標+5, Y=現在のY座標+10) とし、開始地点と低質店の間で 22.4mm のフィラメントを押し出しながら、現在の点から移動先の点 (X=90.6, Y=13.8) に時計回りに移動する。)

G3 X90.6 Y13.8 I5 J10 E22.4

(中心点を X=現在のX座標+5, Y=現在のY座標+10) とし、開始地点と低質店の間で 22.4mm のフィラメントを押し出しながら、現在の点から移動先の点 (X=90.6, Y=13.8) に反時計回りに移動する。)

注意点

1Marlin Firmware では、デルタプリンタースカラープリンター に対しては実装されていません。

G4: 一時停止

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes

一定の時間、マシンを一時停止します。

パラメータ
Pnnn 停止する時間 ミリ秒で指定します。(Teacup では、P0を指定することでそれまでの命令がすべて実行されるまで待機します。)
Snnn 停止する時間 秒で指定します。(Repetier, Marlin, Smoothieware, RepRapFirmware 1.16 以降のみ。)
G4 P200

この場合、200ミリ秒の間、何もしないで待機します。この待機時間の間、マシンの状態 (例: エクストルーダーの加熱など) は保管、制御され続けます。

Marlin, Smoothie, RepRapFirmware では、"S" パラメータを与えると 秒 単位で待機し、"P" パラメータを与えると ミリ秒 単位で待機します。"G4 S2" と "G4 P2000" は等しいことになります。

G6: ステッピングモーターの直接移動

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
No No No No No No No, Use G1 S2 No No No No No

一つ、またはそれ以上のステッピングモーターを、補間や同期された動きのない状態で、ダイレクトに動かします。単位は長さ (例: DELTA> プリンター で mm または インチ の指定)、または角度 (SCARA プリンター) で指定します。このコマンドは、初期化動作や故障診断、キャリブレーションなどに便利なコマンドです。ただし、このコマンドは製品として販売されるものに対しては無効化することが強く勧められます。このような移動方法は、特にデルタボットにおいて危険性を秘めており、実装の際には、素早い往復動作やキャリッジの部品の損傷を防ぐため、動作制限を設定するべきです。

パラメータ
Annn ステッピングモーターAの位置または角度
Bnnn ステッピングモーターBの位置または角度
Cnnn ステッピングモーターCの位置または角度
R 相対移動フラグ
スカラプリンターの例
G6 A45     ; スカラープリンターのステッピングモーターAを45°の位置へ移動する
G6 B20 R   ; スカラープリンターのステッピングモーターBを反時計回りに20°移動する
デルタプリンターの例
G6 C10 R   ; デルタプリンターのキャリッジCを10mm上昇させる

G10: ツールのオフセット

対応状況 FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot grbl Redeem MK4duo
No No No No No No Yes Yes ??? ??? No No
使用方法
G10 Pnnn Xnnn Ynnn Znnn Rnnn Snnn1
パラメータ
Pnnn ツール番号
Xnnn X軸オフセット
Ynnn Y軸オフセット
U,V,Wnnn U, V, W 軸のオフセット5
Znnn Z軸オフセット2
Rnnn スタンバイ温度
Snnn アクティブ温度
G10 P2 X17.8 Y-19.3 Z0.0

(ツール 2 (古いファームウェアではエクストルードヘッド) のオフセットを X, Y, Z それぞれ指定した値へ設定する)

G10 P1 R140 S205

(ツール 1 のスタンバイおよびアクティブ温度3を設定する)

パラメータを設定しなかった場合には、そのパラメーターに対して最後に設定された値が自動的に使われることを覚えておいてください。したがって、通常は Z0.0 が明示的に設定されることとなるでしょう。 RepRapFirmware will report the tool parameters if only the tool number is specified.

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.

The R value is the standby temperature in oC 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. See the 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 .

See also M585.

Notes

1Marlin uses G10/G11 for executing a retraction/unretraction move. The RepRapPro version of Marlin supports G10 for tool offset. Smoothie uses G10 for retract and G10 Ln for setting workspace coordinates.

2It's usually a bad idea to put a non-zero Z 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.

3If 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.

4The NIST G-code standard mentions an additional L parameter, which is ignored (except in smoothie). This command is subject to discussion.

5Tool offsets are applied after any X axis mapping has been performed. Therefore if for example you map X to U in your M563 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.


以下のコンテンツは再翻訳中のコンテンツです。非常にデータが古いため、ベーシックなコード以外は 英語版 を確認するようにして下さい。

コマンド

G28: 原点に移動する(Move to Origin)

Support FiveD Teacup Sprinter Marlin Repetier
yes yes yes yes yes

例: G28

このコマンドは、RepRap機において、X, Y, Z座標が0の位置に戻す。これは、homingとして知られる処理である。 この処理を速く行うために、移動スピードは加速される。しかし、各座標が1mmのところまで戻るとゆっくりと移動し、その後、止まる。これは、より正確な位置に戻るために行われる。

もし、G28コマンドに座標を指定すると、指定された座標を0と扱われる。つまり、

G28 X0 Y72.3

は、XとZは0に戻るが、Yは0に戻らない。実際の座標は無視される。

G29-G32: Bed probing

G29 Detailed Z-Probe

probes the bed at 3 points.

G30 Single Z Probe

In its simplest form probes bed at current XY location.

Some implementations allow more general behaviour: if a Pn field is specified the probed X, Y, and Z values are saved as point n on the bed for calculating the offset plane. Generally n is 0, 1, or 2. If X, or Y, or Z values are specified (e.g. G30 P1 X20 Y50 Z0.3) then those values are used instead of the machine's current coordinates. A silly Z 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 specfied (e.g. G30 P1 Z0.3 S) the bed plane is computed for compensation and stored. The combination of these options allows for the machine to be moved to points using G1 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 GCode file for automatic execution.

G31 Report Current Probe status

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: G31 P312 Z0.7) this will set the Z height to 0.7mm when the Z-probe value reaches 312 when a G28 Z0 (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 G31 Z0.7 will tell the RepRap machine that it is at a height of 0.7mm when the probe is triggered.

In Duet-dc42 firmware, separate G31 parameters may be defined for probe types 0, 1/2, and 3 (probe types 1 and 2 share the same set of parameters). To specify which probe you are setting parameters for, send a M558 command to select the probe type before the G31 command.

Duet-dc42 firmware supports additional parameters S (bed temperature in degC at which the specified Z parameter is correct, default is current bed temperature), and C (temperature coefficient of Z parameter in mm/degC, default zero). This is useful for ultrasonic and other probes that are affected by temperature.

G32 Probe Z and calculate Z plane

probes the bed at 3 or 4 pre-defined points (see M557) and updates transformation matrix for bed leveling compensation.

バッファに格納されないGコマンド

The following commands are not buffered. When one 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.

Teacup Firmware buffers G20, G21, G90 and G91.

G20: 単位をインチに指定する

例: G20

単位をインチに指定する

G21: 単位をインチに指定する

例: G21

単位をミリメートルに指定する (RepRapのデフォルトはミリメートルである)

G90: 絶対的な位置を設定(Set to Absolute Positioning)

例: G90

全ての座標は、マシンの原点からの絶対的な位置となる。(これはRepRapのデフォルトである)

G91: 相対的な位置を設定する(Set to Relative Positioning)

例: G91

全ての座標は、最後の位置の相対的な位置となる。

G92: 位置を指定する(Set Position)

例: G92 X10 E90

現在の座標を指定した値にリセットする。これは、原点に対して絶対座標を指定するプログラムを可能にする。 上記の例は、マシンのX座標を10、押出座標を90に設定する。物理的な移動は起きない。

座標を指定しないG92は、全ての軸を0にリセットする。

バッファに格納されないM及びTコマンド

M0: Stop

例: M0

RepRap機は、バッファの中のデータを残したまま、移動を終了してシャットダウンする。全てのモーター、ヒーターの電源はOFFとなる。マスターコントローラのリセットボタンを押すことによって、再度、開始される。M1, M112参照。

M1: スリープ(Sleep)

例: M1

RepRapマシンはバッファにデータを残したまま動作を終了し、シャッドダウンする。全てのモーター、ヒーターの電源がオフとなる。Gコード、Mコードは、まだ送信することができる。GコードもしくはMコードのどちらか最初のコマンドがRepRapマシンをスリープから復帰させる。M0, M112参照。

M3: スピンドルを時計回りでオンにする(Spindle On, Clockwise (CNC specific))

例: M3 S4000

4000RPMのスピードで、スピンドルをOnにする

M4: スピンドルを反時計回りでオンする(Spindle On, Counter-Clockwise (CNC specific))

例: M4 S4000

スピンドル(Spindle)を反時計回りでスピード4000RPMでオンする。

M5: Spindle Off (CNC specific)

例: M5

スピンドルをOffにする。

M7: ミストクーラントをオンにする(Mist Coolant On (CNC specific))

例: M7

(もし、利用できるならば、)ミストクーラントをオンにする

ミストクーラントは以下の映像。 https://www.youtube.com/watch?v=tXcSk3PkaHY

M8: フラッドクーラントをオンにする(Flood Coolant On (CNC specific))

例: M8 (もし利用できるならば、)フラッドクーラントをオンにする

フラッドクーラントは以下の映像。 https://www.youtube.com/watch?v=IkmbmzDuKnE

M9: クーラントをオフにする(Coolant Off (CNC specific))

例: M9

全てのクーラントシステムをオフにする

M10: バキュームをOnにする(Vacuum On (CNC specific))

例: M10

ゴミを取り除くバキューム(掃除機)システムをOnにする

M11: バキュームをOffにする(Vacuum Off (CNC specific))

例: M11

ゴミを取り除くバキューム(掃除機)システムをOffにする

M17: 全てのステッパーモーターの電源を入れる(Enable/Power all stepper motors)

例: M17

全てのステッパーモーターの電源を入れる or オンにする

ステッパーモーター http://simple.wikipedia.org/wiki/Stepper_motor

M18: 全てのステッパーモーターの電源をオフ or 回転をオフ(Disable all stepper motors)

例: M18

全てのステッパーモーターの電源をオフ or 回転をオフにする そして、(軸に自由に動作することを許可する???)

Disables stepper motors and allows axis to move 'freely.'

M20: SDカード上のファイルをリストアップする(List SD card)

例: M20

SDカードのルートフォルダの全てのファイルをリストアップしシリアルポートに対して出力する。 これは、以下のような出力となる。

ok Files: {SQUARE.G,SQCOM.G,}

最後のカンマはオプションである。ファイル名は大文字で出力される。 M23コマンドが送られたとき、ファイル名は小文字にしなければならない。

M21: SDカードの初期化(Initialize SD card)

例: M21

SDカードは初期化される。プリンタの電源がONになったときSDカードがロードされているならば、デフォルトで初期化が起こる。 SDカードは他のSDカードの機能を動作させるために初期化されなければならない。

M22: SDカードの取り外し(Release SD card)

例: M22

SDカードはリリースされ、物理的に取り外すことができる。

M23: SDカードからファイルを選択する(Select SD file)

例: M23 filename.gco

    M23 ファイル名

finename.gco(8.3 ファイル名の命名規則をサポートすること)として指定されたファイルを印刷するために選択する。。

M24: SDカード上のファイルからの印刷を開始もしくは再開する(Start/resume SD print)

例: M24

M23コマンドで選択されたファイルから印刷する

M25: SDカードからの印刷を一時停止する(Pause SD print)

例: M25

M23コマンドで選択されたファイルの現在の位置で、SDカードからの印刷を一時停止する。

M26: SDカードの位置を指定する(Set SD position)

例: M26

SDカードの位置をバイト単位で指定する。(M26 S12345).

M27: SDカードからの印刷のステータスをレポートする(Report SD print status)

例: M27

SDカードからの印刷のステータスをレポートする

M28: SDカードに書き込みを開始する(Begin write to SD card)

例: M28 filename.gco

    M28 ファイル名

指定されたファイル名のファイルがSDカード上に作成される。プリンタに送信された全てのコマンドがそのファイルに書き込まれる。

M29: SDカードに書き込む(Stop writing to SD card)

例: M29 filename.gco

    M29 ファイル名

M28コマンドでオープンしたファイルをクローズする。プリンタに送信された全てのコマンドは、 送信された順番に通常通り実行される。

M30: SDカード上のファイルを削除する(Delete a file on the SD card)

例: M30 filename.gco

    M30 ファイル名

filename.gcoを削除する。

M32: SDカードからファイルを選択し、SDカードからの印刷を開始する(Select file and start SD print)

例: M32 filename.gco M32 ファイル名

Marinで使用可能。

M40: エジェクト (Eject)

もしRepRapマシーンがビルドプレートからパーツを外しエジェクトできる場合、このコマンドはエジェクトサイクルを実行します。

これは通常、ベッドを冷却し部品を取り除く一連の動きを行います。エジェクト動作終了時のX,Y及びZ位置は未定義となります。 (ただし、M114コマンドを使用して現在の位置を取得することができます。q.v.)

関連するコマンド:M240 M241 も参照してください。

M41: Loop

Example: M41

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:

  1. When you press the reset button,
  2. When the build material runs out (if your RepRap is set up to detect this), and
  3. When there's an error (such as a heater failure).

M42: Stop on material exhausted / Switch I/O pin

M42 in ???

Example: M42

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. You have to press reset to reactivate the machine. In other words, it parks itself and then executes an M0 command (q.v.).

M42 in Marlin/Sprinter

Example: M42 P7 S255

M42 switches a general purpose I/O pin. Use M42 Px Sy to set pin x to value y, when omitting Px the LEDPIN will be used.

M42 in Teacup

Not needed. General purpose devices are handled like a heater, see M104.

M43: Stand by on material exhausted

Example: M43

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.

M43: Pin report and debug

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Usage
M43 En Pnnn Wn In
Parameters
En Enable / disable background endstop monitoring
Pnnn Pin to read or watch. If omitted, read/watch all pins
Wn bool watch pins -reporting changes- until reset, click, or M108
In bool Flag to ignore pin protection
Note
You must have PINS_DEBUGGING uncommented in your Configuration_adv.h file for M43 to work.

M44: Codes debug - report codes available

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
??? ??? ??? ??? ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? ??? ??? ??? ??? ??? ??? No

In MK4duo must have ability FASTER_GCODE_EXECUTE for this function.

Parameters
In G-code list
Jn M-code list

M44: Reset the bed skew and offset calibration

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
??? ??? ??? ??? ??? Yes ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? ??? ??? ??? ??? ??? ??? ???

Resets the bed skew and offset calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.

M45: Bed skew and offset with manual Z up

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
??? ??? ??? ??? ??? Yes ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? ??? ??? ??? ??? ??? ??? ???

Runs the xyz calibration on Prusa i3 MK2/s,MK2.5/s,MK3/s.

Parameters
Vnn Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. This parameter is optional.

M46: Show the assigned IP address

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
??? ??? ??? ??? ??? Yes ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? ??? ??? ??? ??? ??? ??? ???

Reports the assigned IP address of a Toshiba FlashAir on Prusa i3 MK2/s,MK2.5/s,MK3/s. At this moment it is deactivated.

M47: Show end stops dialog on the display

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
??? ??? ??? ??? ??? Yes ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? ??? ??? ??? ??? ??? ??? ???

Show end stops dialog on the display on Prusa i3 MK2/s,MK2.5/s,MK3/s.

M48: Measure Z-Probe repeatability

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? Yes1 Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Pnnn number of points
Xnnn position on the X axis
Ynnn position on the Y axis
Vnnn verbosity
E engage
Lnnn legs of travel
S schizoid

As with G29, the E flag causes the probe to stow after each probe.

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.


Prusa specific 1

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.

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.

Usage

M48 nAA Xnnnn Ynnnn Vn Lnn

Parameters
nAA number(AA) of samples, default=10 (valid values between 4 and 50)
Xnnn X position for samples
Ynnn Y position for samples
Vn Verbosity level 1-4 (low to highest)
Lnn Legs of travel 1-15

M49: Set G26 debug flag

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No No No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M49 S1 ; Enable G26 verbose debug output

M70: Display message

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M117 M117 M117 M117 No No No Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No M117 No M117
Example
M70 P200 Message

Display a message on the LCD. P is the time to display message for.

M72: Play a tone or song

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M300 M300 No No No M300 No Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No: See M300
Example
M72 P2

Instruct the machine to play a preset song. Acceptable song IDs are machine specific. P is the ID of the song to play.

M73: Set/Get build percentage

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? Yes1 Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Example
M73 P50

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.

Use "M73" by itself to get a report of the current print progress.

Prusa specific1

Prusa firmware just shows percent done and time remaining.

Usage

M73 P R Q S

Parameters
This command can be used without any additional parameters.
P Percent in normal mode
R Time remaining in normal mode
Q Percent in silent mode
S Time remaining in silent mode
Examples
M73
echo NORMAL MODE: Percent done: ---%; print time remaining in mins: -----"
echo SILENT MODE: Percent done: ---%; print time remaining in mins: -----"

M75: Start the print job timer

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No No No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

M76: Pause the print job timer

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No No No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

M77: Stop the print job timer

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No No No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

M78: Show statistical information about the print jobs

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No No No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

M80: ATX Power On

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes No ??? Yes1 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No No automatic No
Examples
M80    ; 電源をONにする
M80 S  ; 電源のステータスをリポートする (Marlin 1.1.1)

ATX電源をスタンバイモードから完全な動作モードに移行します。スタンバイモードが無い場合は動作しません。

Notes
  • Marlinはコンフィギュレーションオプション POWER_SUPPLY にゼロではない値を設定する必要があります。 M80.
  • いくつかのファームウェア (e.g., Teacup) では自動で電源を on/off します。これは助長な動作です。参照: RAMPS wiring for ATX on/off.
  • Prusaは defined (PS_ON_PIN)PS_ON_PIN must be set.1を要求します。

M81: ATX Power Off

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes No ??? Yes1 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No Yes automatic No
パラメーター
P デーモンの終了 (redeem only)
R デーモンの再起動 (redeem only)
Sn n=0 即時電源を切る (default), n=1 すべてのサーモスティックファンがOFFになったら電源を切る (RepRapFirmware 1.20 and later only)
Examples
M81  ; 電源を即時OFF
M81 S1 ; すべての冷却が完了したら電源を切る (RepRapFirmware)

ATX電源をOFFにします。. M80に対応します.

Notes
  • Prusaは defined (PS_ON_PIN)PS_ON_PINとしてパワーオフを設定します。1

M82: Set extruder to absolute mode

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No No Yes Yes
Example
M82

Makes the extruder interpret extrusion as absolute positions.

This is the default in repetier and for Yaskawa controllers.

M83: Set extruder to relative mode

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No No Yes Yes
Example
M83

Makes the extruder interpret extrusion values as relative positions.

Note that the Ultimaker 3 will revert back to absolute extrusion after each tool change.

M84: Stop idle hold

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes2 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No Yes Yes No
Parameters
This command can be used without any additional parameters.
Innn Reset flags1
Example
M84

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.

On Marlin, Repetier and RepRapFirmware, M84 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. For Yaskawa systems M84 is not applicable due to servo motors not producing the annoying noises.

Notes

1RepRapFirmware-dc42 and other firmware may not support this parameter.

2Prusa firmware uses M84 similar to G-code#M18:_Disable_all_stepper_motors

Prusa Usage
M84 E S X Y Z
Prusa Parameters
This command can be used without any additional parameters.2
E Extruder drive(s)2
S Seconds
X X axis
Y Y axis
Z Z axis

M85: Set Inactivity Shutdown Timer

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No Yes No ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No No No No
Example
M85 S30

Set Inactivity Shutdown Timer with parameter S<seconds>. "M85 S0" will disable the inactivity shutdown time (default)

M86: Set Safety Timer expiration time

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? Yes No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M86 Snnnn
Parameters
S Seconds

Similar to M85 but applies to the "safety timer" in Prusa Firmware.

Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.

When safety timer expires, heatbed and nozzle target temperatures are set to zero.

M92: Set axis_steps_per_unit

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No Yes No No
Parameters
Xnnn Steps per unit for the X drive
Ynnn Steps per unit for the Y drive
Znnn Steps per unit for the Z drive
Ennn Steps per unit for the extruder drive(s)
Snnn Defines in which microstepping the above steps per unit are given. If omitted it will use the microstepping currently set by M350.1
Examples
M92 X87.489 Y87.489 Z87.489
M92 E420:420

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 (M500 in Marlin) or in the configuration file (config.g in RepRapFirmware). Very useful for calibration.

RepRapFirmware will report the current steps/mm if you send M92 without any parameters. For Yaskawa systems M92/M93 is not applicable due to use of servo motors.

Notes

1 Only available in RepRapFirmware >=2.03

M93: Send axis_steps_per_unit

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Use M92 ??? No ??? ??? No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No No No No

M98: Call Macro/Subprogram

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No Yes
Parameters
Pnnn Macro filename
Example
M98 Pmymacro.g

Runs the macro in the file mymacro.g. In conventional G Codes for CNC machines the P 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 G98 call. That G-code file does not need to end with an M99 (return) as the end-of-file automatically causes a return. RepRapFirmware supports nested macro calls up to a depth of 5.

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.

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 on RepRapFirmware too.

M99: Return from Macro/Subprogram

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No Yes
Example
M99

Returns from an M98 call.

RepRapFirmware closes the currently active macro file. If a nested macro is being run, RepRapFirmware goes up one stack level.

M101: Turn extruder 1 on (Forward), Undo Retraction

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes: 1.17c and later No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No Yes No

In Teacup firmware: If a DC extruder is present, turn that on. Else, undo filament retraction, which means, make the extruder ready for extrusion. Complement to M103.

In BFB/RapMan: Turn extruder on (forward/filament in).

In RepRapFirmware: undo filament retraction. The length and speed are set by the M207 command. RepRapFirmware supports this command for compatibility with Simplify3D.

In other firmwares: Deprecated. Regarding filament retraction, see G10, G11, M207, M208, M227, M228, M229.

M102: Turn extruder 1 on (Reverse)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

In BFB/RapMan firmware: Turn extruder on Reverse (Still to add)

In other firmwares: Deprecated.

M103: Turn all extruders off, Extruder Retraction

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes: 1.17c and later No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No Yes No

In Teacup firmware: If a DC extruder is present, turn that off. Else, retract the filament in the hope to prevent nozzle drooling. Complement to M101.

In BFB/RapMan firmware: Turn extruder off.

In RepRapFirmware: retract filament. The length and speed are set by the M207 command. RepRapFirmware supports this command for compatibility with Simplify3D.

In other firmwares: Deprecated. Regarding filament retraction, see G10, G11, M207, M208, M227, M228, M229.

M104: Set Extruder Temperature

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes Yes Yes Yes Yes Yes Yes
Parameters
Snnn Target temperature
Rnnn Idle temperature (Only MK4duo)
Example
M104 S190
M104 S190 R170

Set the temperature of the current extruder to 190oC and return control to the host immediately (i.e. before that temperature has been reached by the extruder). See also M109.

See also using G10. Deprecation of M104 is subject to discussion. --Traumflug 11:33, 19 July 2012 (UTC)

M104 in Marlin Firmware

See Marlin Wiki. In Marlin Firmware, using M104 with no parameters will turn off the heater for the current extruder. This is also the case for M104 S without a number after the S parameter.

M104 in Teacup Firmware

In Teacup Firmware, M104 can be additionally used to handle all devices using a temperature sensor. It supports the additional P parameter, which is a zero-based index into the list of sensors in config.h. For devices without a temp sensor, see M106.

Example
M104 P1 S100

Set the temperature of the device attached to the second temperature sensor to 100°C.

M104 in Duet-dc42

Duet-dc42 and other firmware also supports the optional T parameter (as generated by slic3r) to specify which tool the command applies to.

M105: Get Extruder Temperature

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes1 Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No Yes No Yes Yes No
Parameters
This command can be used without any additional parameters.
Rnnn Response sequence number1
Snnn Response type1
Examples
M105
M105 S2

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:

ok T:201 B:117
ok T:201 /202 B:117 /120
ok T:201 /202 B:117 /120 C:49.3 /50
ok T:201 /202 T0:110 /110 T1:23 /0 B:117 /120 C:49.3 /50
ok T0:110 /110 T1:23 /0 B:117 /120
ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 [email protected]:0 P:19.8 A:26.4

The parameters mean the following:

  • 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)
  • B - bed temperature
  • C - chamber temperature
  • @ - Hotend power (Prusa only)1
  • [email protected] - Bed power (Prusa only)1
  • P - PINDAv2 actual (Prusa MK2.5/s MK3/s only)1
  • A - Ambient actual (Prusa MK3/s only)1

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.

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.

Expansion/generalization of M105 to be considered using S1 parameter as noted in Pronterface I/O Monitor

In Repetier and MK4duo you can add X0 (X1 MK4duo) to get raw values as well:

M105 X0
==> 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

Recent versions of RepRapFirmware also report the current and target temperatures of all active heaters.

Notes

1These parameters are only supported by RepRapFirmware, which returns a JSON-formatted response if parameter S2 or S3 is specified. Additionally, parameter Rnn may be provided, where nn is the sequence number of the most recent G-code response that the client has already received. M105 S2 is equivalent to M408 S0, and M105 S3 is equivalent to M408 S2. Usage of these forms of M105 is deprecated, please use M408 instead.

M106: ファンオン (Fan On)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes Yes Yes Yes Yes Yes Yes
パラメーター
Pnnn ファン番号 (オプション, デフォルトでは 0)2
Snnn ファン速度 (0-255; RepRapFirmware の場合は 0.0 to 1.0))
追加パラメーター
Innn Invert signal, or disable fan1 3
Fnnn HzでPWM周波数の設定 1 3
Lnnn 最低ファン速度を設定 (0 to 255 or 0.0 to 1.0)1 3
Xnnn 最大ファン速度を設定 (0 to 255 or 0.0 to 1.0)1 3
Bnnn Blip time - fan will be run at full PWM for this number of seconds when started from standstill1
Hnn:nn:nn... Select heaters monitored when in thermostatic mode1 3
Rnnn Restore fan speed to the value it has when the print was paused1
Tnnn Set thermostatic mode trigger temperature
Cnnn Set custom name (RRF > 2.01 only)1
M106 S127
例 (RepRapFirmware)
M106 P1 I1 S87
M106 P1 T45 H1:2
M106 P2 B0.1 L0.05

最初の例ではクーリングファンを半分の速度で運転します。

二つ目の例では 2つ目のファンの信号を反転させ、1/3(≒87/255)の速度で運転します。 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. Mandatory parameter 'S' declares the PWM value (0-255). M106 S0 turns the fan off. In some implementations like RepRapFirmware the PWM value may alternatively be specified as a real fraction: M106 S0.7.

Notes

1このパラメーターはRepRapFirmwareでのみ有効です。.

2Marlin 1.0から 1.1.6 では2つのファンまでをサポートします。Marlin 1.1.7かそれ以上では3つのファンをサポートしています。

3このパラーメーターはMK4duoでのみ有効です。

M106 in RepRapFirmware

If an S 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 F parameter in the M563 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 R2 parameter (see below).

If no S parameter is given but the R1 parameter is used, the fan speed when the print was last paused will be set. If the R2 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).

The T and H 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 H parameter is at or above the trigger temperature set by the T parameter, and off otherwise. Thermostatic mode can be disabled using parameter H-1.

The B 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.

The L 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. The X 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.

The I 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 I 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 M42.

M106 in Teacup Firmware

上記に加えて、TeacupファームウェアではM106を使用して一般的なデバイスを制御します。 Additionally to the above, Teacup Firmware It supports the additional P parameter, which is an zero-based index into the list of heaters/devices in config.h.

Example
M106 P2 S255

Turn on device #3 at full speed/wattage.

Note: When turning on a temperature sensor equipped heater with M106 and M104 at the same time, temperature control will override the value given in M106 quickly.

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.

Note: If M104 is (or becomes) active on a heater (or other device) with a feedback sensor it will correct any M106 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

M107: ファンオフ(Fan Off)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes Yes Yes Yes Yes No Yes

Teacup firmware及びRepRapFirmwareでは非推奨。 代わりにM106 S0を使う様にする。

M108: Cancel Heating

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes No No ??? ??? Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

Breaks out of an M109 or M190 wait-for-temperature loop, continuing the print job. Use this command with caution! If cold extrusion prevention is enabled (see M302) 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.

This command was introduced in Marlin 1.1.0. As with other emergency commands [e.g., M112] this requires the host to leave space in the command buffer, or the command won't be executed until later.

Recent versions of Marlin introduce EMERGENCY_PARSER, 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.

M108: Set Extruder Speed (BFB)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

Sets speed of extruder motor. (Deprecated in FiveD firmware, see M113)

M109: Set Extruder Temperature and Wait

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No Yes Yes Yes not needed Yes
Parameters
Snnn minimum target temperature, waits until heating
Rnnn maximum target temperature, waits until cooling (Sprinter)
Rnnn accurate target temperature, waits until heating and cooling (Marlin and MK4duo)
Example
M109 S215
M109 in Teacup

Not needed. To mimic Marlin behaviour, use M104 followed by M116.

M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa

Set extruder heater temperature in degrees celsius and wait for this temperature to be achieved.

Example
M109 S185

RepRapFirmware also supports the optional T parameter (as generated by slic3r) to specify which tool the command refers to (see below).

M109 in Sprinter (4pi port)

Parameters: S (optional), set target temperature value. If not specified, waits for the temperature set by M104. R (optional), sets target temperature range maximum value.

Example
M109 S185 R240 ; set extruder temperature to 185 and wait for the temperature to be between 185 - 240.

If you have multiple extruders, use T or P parameter to specify which extruder you want to set/wait.

Another way to do this is to use G10.

M109 in MakerBot
Example
M109 S70 T0

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.

M110: Set Current Line Number

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No Yes No Yes not needed No
Parameters
Nnnn Line number
Example
M110 N123

This example sets the current line number to 123. Thus the expected next line after this command will be 124.

M111: Set Debug Level

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes No ??? No2 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No Yes No Yes Debug No
Parameters
Pnnn Debug module1
Snnn Debug on/off
Examples
M111 S6
M111 P1 S1

Enable or disable debugging features in the firmware. The implementation may look different per firmware.

Notes

1This parameter is only available in RepRapFirmware.

2Prusa fimrware use D-codes/commands for debugging.

M111 in RepRapFirmware

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 M111 S1 P15.

M111 in Repetier

Set the level of debugging information transmitted back to the host to level 6. The level is the OR of three bits:

#define DEBUG_ECHO (1<<0)
#define DEBUG_INFO (1<<1)
#define DEBUG_ERRORS (1<<2)
#define DEBUG_DRYRUN (1<<3) // repetier-firmware
#define DEBUG_COMMUNICATION (1<<4) // repetier-firmware

Thus 6 means send information and errors, but don't echo commands. (This is the RepRap default.)

For firmware that supports ethernet and web interfaces M111 S9 will turn web debug information on without changing any other debug settings, and M111 S8 will turn it off. Web debugging usually means that HTTP requests will be echoed to the USB interface, as will the responses.

M112: Full (Emergency) Stop

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No Yes No Yes Yes No
Example
M112

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 M0 and M1.

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.


M113: Set Extruder PWM

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No Yes No No No No
Example
M113

Set the PWM for the currently-selected extruder. On its own this command 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:

M113 S0.7

it causes the PWM to be set to the S value (70% in this instance). M113 S0 turns the extruder off, until an M113 command other than M113 S0 is sent.

M113: Host Keepalive

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.9+ No No No ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

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.

Usage
M113 Snnn
Parameters
Snnn keepalive interval to set
Examples
M113 S2

M114: Get Current Position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No Yes No Yes Yes No
Example
M114

This causes the RepRap machine to report its current X, Y, Z and E coordinates to the host.

For example, the machine returns a string such as:

ok C: X:0.00 Y:0.00 Z:0.00 E:0.00

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.

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

M115: Get Firmware Version and Capabilities

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes No ??? Yes2 Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No Yes No Yes Yes No
Parameters
This command can be used without any additional parameters.
Bnnn (RepRapFirmware 3 only) Expansion board number (typically the CAN address) for which the firmware version is requested, default 0 (i.e. main board)
Pnnn Electronics type1
V Report the Prusa version number2
Unnnnnn Check the firmware version provided2
Examples
M115
M115 P2

Request the Firmware Version and Capabilities of the current microcontroller The details are returned to the host computer as key:value pairs separated by spaces and terminated with a linefeed.

sample data from firmware:

ok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1

This M115 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 M408 command for a more comprehensive report on machine capabilities supported by RepRapFirmware.

Notes

1This parameter is supported only in RepRapFirmware and can be used tell the firmware about the hardware on which it is running. If the P parameter is present then the integer argument specifies the hardware being used. The following are currently supported:

M115 P0   Automatic board type selection if supported, or default if not
M115 P1   Duet 0.6
M115 P2   Duet 0.7
M115 P3   Duet 0.85

2These parameters are only supported in Prusa Firmware. Parameter Unnnnnn 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.

sample data M115:

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

sample data M115 V

3.8.1

sample data on display for 30s or user interactionM115 U3.8.2-RC1

New firmware version availible:
3.8.2-RC1
Please upgrade.

M116: Wait

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes Yes No ??? No Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No Yes No Yes Yes No
Parameters
This command can be used without any additional parameters.1
Pnnn Tool number
Hnnn Heater number
Cnnn Chamber number
Examples
M116
M116 P1

Wait for all temperatures and other slowly-changing variables to arrive at their set values if no parameters are specified. See also M109.

Notes

1Most 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.

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.

M117: Get Zero Position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No No: See M70
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No Yes No No No No
Example
M117

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 x 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.)

M117: Display Message

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes1 Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No Yes No No
Example
M117 Hello World

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.

Notes

In Prusa Firmware it is also used to display internal messages on LCD.1

M118: Echo message on host

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.4+ No No No ??? ??? Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

Use this code to print a visible message to the host console, preceded by 'echo:'.

Example
M118 Color changing to blue

M118: Negotiate Features

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M118 P42

This M-code is for future proofing. NO firmware or hostware supports this at the moment. It is used in conjunction with M115's FEATURES keyword.

See Protocol_Feature_Negotiation for more info.

M119: Get Endstop Status

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No Yes Yes No
Example
M119

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.

In redeem, M119 can also be used to invert end stops.

Example
M119 X1 1

This will invert end stop X1 (Inverted means switch is connected in Normally Open state (NO))

M120: Push

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No Yes ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M120

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

  1. Current feedrate, and
  2. Whether moves (and separately extrusion) are relative or absolute

RepRapFirmware calls this automatically when a macro file is run. In addition to the variables above, it pushes the following values on the stack:

  1. Current feedrate
  2. Extruder positions

M121: Pop

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No Yes ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M121

Recover the last state pushed onto the stack.

M120: Enable endstop detection

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? M121 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

M121: Disable endstop detection

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? M120 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

M122: Firmware dependent

M122: Diagnose (RepRapFirmware)
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Bmmm Expansion board number for which diagnostics are requested, default 0 which means main board
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.
Example
M122

Sending an M122 causes the RepRap to transmit diagnostic information, for example via a USB serial link.

If RepRapFirmware is used and debugging is enabled for the Network module, this will also print LWIP stats to the host via USB.

M122: Set Software Endstop (MK4duo)
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

Disabled or Enabled Software Endstop M122 S<0/1>

M122: Debug L6470 drivers (Marlin)
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

Get diagnostic info about all L6470 stepper drivers.

Example
M122

M123: Firmware dependent

M123: Tachometer value (RepRap)
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

Sending an M123 causes the RepRap to transmit filament tachometer values from all extruders.

M123: Endstop Logic (MK4duo)
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Xn X Logic
Yn Y Logic
Zn Z Logic
In X2 Logic
Jn Y2 Logic
Kn Z2 Logic
Pn Probe Logic
Dn Door Logic
Examples
M123 ; Print Status
M123 X1 Y1 Z0 P0

M124: Firmware dependent

M124: Immediate motor stop
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

Immediately stops all motors.

M124: Set Endstop Pullup
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Xn X Pullup on/off
Yn Y Pullup on/off
Zn Z Pullup on/off
In X2 Pullup on/off
Jn Y2 Pullup on/off
Kn Z2 Pullup on/off
Pn Probe Pullup on/off
Dn Door Pullup on/off
Examples
M124 ; Print Status
M124 X1 Y1 Z0 P0

M126: Open Valve

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? ??? Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No Yes No No No No
Example
M126 P500

Open the extruder's valve (if it has one) and wait 500 milliseconds for it to do so.

M126 in MakerBot
Example
M126 T0

Enables an extra output attached to a specific toolhead (e.g. fan)

M127: Close Valve

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? ??? Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No Yes No No No No
Example
M127 P400

Close the extruder's valve (if it has one) and wait 400 milliseconds for it to do so.

M127 in MakerBot
Example
M127 T0

Disables an extra output attached to a specific toolhead (e.g. fan)

M128: Extruder Pressure PWM

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? ??? Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M128 S255

PWM value to control internal extruder pressure. S255 is full pressure.

M129: Extruder pressure off

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? ??? Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M129 P100

In addition to setting Extruder pressure to 0, you can turn the pressure off entirely. P400 will wait 100ms to do so.

M130: Set PID P value

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M301 M301 No M301 ??? M301 No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No M301 Yes M301
Parameters
Pnnn heater number
Snnn proportional (Kp)
Example
M130 P0 S8.0  ; Sets heater 0 P factor to 8.0

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).

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.

M131: Set PID I value

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M301 M301 No M301 ??? M301 No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No M301 Yes M301
Parameters
Pnnn heater number
Snnn integral (Ki)
Example
M131 P1 S0.5  ; Sets heater 1 I factor to 0.5

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.

M132: Set PID D value

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M301 M301 No M301 ??? M301 No Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No M301 Yes M301
Parameters
Pnnn heater number
Snnn derivative (Kd)
Example
M132 P0 S24  ; Sets heater 0 D factor to 24.0

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).

M132 in MakerBot
Example
M132 X Y Z A B

Loads the axis offset of the current home position from the EEPROM and waits for the buffer to empty.

M133: Set PID I limit value

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M301 M301 No No ??? M301 No Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No M301 Yes M301
Parameters
Pnnn heater number
Snnn integral limit (Ki)
Example
M133 P1 S264  ; Sets heater 1 I limit value to 264

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.

M133 in MakerBot

Wait for the toolhead to reach its target temperature.

Parameters
Tnn : Extruder to wait for
Pnn : Time limit, in seconds
Example
M133 T0 P500 ; Wait for Tool 0 to reach target. Fail after 8:20.

M134: Write PID values to EEPROM

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No: See M500 No No: See M504 ??? No No Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No Yes No
Example
M134
M134 in MakerBot
Example
M134 T0 P500

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.

M135: Set PID sample interval

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Snnn Heat sample time in seconds
Example
M135 S300

Set the PID to measure temperatures and calculate the power to send to the heaters every 300ms.

M135 in MakerBot
Example
M135 T0

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.

M136: Print PID settings to host

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No M301 No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No Debug No
Example
M136 P1  ; print heater 0 PID parameters to host

M140: Set Bed Temperature (Fast)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No Yes Yes Yes Yes Yes
Parameters
Pnnn Bed heater index1
Hnnn Heater number1
Tnnn Tool number2
Snnn Active/Target temperature
Rnnn Standby temperature1 2
Example
M140 S55

Set the temperature of the build bed to 55oC and return control to the host immediately (i.e. before that temperature has been reached by the bed).

Notes

1 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:

M140 S-273.15

2 These parameters are only supported in MK4duo for Idle temperature

M140 S60 R30
M140 T1 S60 R30

There is an optional R field that sets the bed standby temperature: M140 S65 R40.

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.

M141: Set Chamber Temperature (Fast)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes No No ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No Yes No uses M104 No
Parameters
Pnnn Chamber index1
Hnnn Heater number1
Tnnn Tool number2
Snnn Active/Target temperature
Rnnn Standby temperature1 2
Examples
M141 S30
M141 H0

Set the temperature of the chamber to 30oC and return control to the host immediately (i.e. before that temperature has been reached by the chamber).

Notes

1 These parameters are only supported in RepRapFirmware and work just like in M140.

2 These parameters are only supported in MK4duo and work just like in M140.

M142: Firmware dependent

M142: Holding Pressure
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M142 S1

Set the holding pressure of the bed to 1 bar.

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.

M142: Set Cooler Temperature (Fast)
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Tnnn Tool number
Snnn Active/Target temperature
Rnnn Standby temperature
Examples
M142 S60
M142 S60 R30
M141 T1 S60 R30

Set the temperature of the cooler

M143: Maximum heater temperature

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
H Heater number (RepRapFirmware 1.17 and later, default 1 which is normally the first hot end)
S Maximum temperature
Examples
M143 S275      ; set the maximum temperature of the hot-end to 275°C
M143 H0 S125   ; set the maximum bed temperature to 125C

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.

When the temperature of the heater exceeds this value, countermeasures will be taken.

M144: Bed Standby

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Pnn Bed heater number, default 0
Sn 0 = set bed heater to standby (default), 1 = set bad heater active
Example
M144

Switch the bed heater to its standby temperature. M140 S1 turns it back to its active temperature.

M146: Set Chamber Humidity

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Rnnn Relative humidity in percent
Example
M146 R60

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).

M149: Set temperature units

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
C Flag to treat temperature as degrees Celsius
K Flag to treat temperature as Kelvin
Example
M149 K

It affects the S or R values in the codes M104, M109, M140, M141, M143, M190 and G10. The default is M149 C.

M150: Set LED color

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes See below No No ??? No1 Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Rnnn Red component
Unnn Green component
Bnnn Blue component
Wnnn White component (Marlin)
Pnnn Brightness (0-255) (Marlin)
P Set full brightness (Marlin)
Snnn Number of individual LEDs to set, default 1 (RepRapFirmware)
Example
M150 R255 U128 B192

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.

RepRapFirmware uses this command to control DotStar LED strips on controllers that provide a connector for this purpose.

Notes

In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.1

M155: Automatically send temperatures

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.0+ No Yes No ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Snnn enable sending temperatures = 1, disable = 0
Example
M155 S1

Hosts normally monitor printer temperatures by sending M105 every couple of seconds. This not only adds serial traffic but it will fail whenever the command queue is full. M155 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 M155 the output of M115 will report the AUTOREPORT_TEMP capability:

Cap:AUTOREPORT_TEMP:1

M160: Number of mixed materials

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M160 S4

This command has been superseded by the tool definition command M563 (see below).

Set the number of materials, N, that the current extruder can handle to the number specified. The default is 1.

When N >= 2, then the E field that controls extrusion requires N values separated by colons ":" after it like this:

M160 S4
G1 X90.6 Y13.8 E2.24:2.24:2.24:15.89
G1 X70.6 E0:0:0:42.4
G1 E42.4:0:0:0

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.

The third line moves back 20mm in X extruding 42.4mm of filament.

The fourth line has no physical effect.

M163: Set weight of mixed material

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.0+ M567 0.92+ No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Snnn extruder number
Pnnn weight

Set weight for this mixing extruder drive.
See Repetier Color Mixing for more informations.

M164: Store weights

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.0+ No 0.92 No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Snnn virtual extruder number
Pnnn store to eeprom (P0 = no, P1 = yes)

Store weights as virtual extruder S.

M165: Set multiple mix weights

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.0+ M567 No: No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters A B C D H I
A[factor] Mix factor for extruder stepper 1
B[factor] Mix factor for extruder stepper 2
C[factor] Mix factor for extruder stepper 3
D[factor] Mix factor for extruder stepper 4
H[factor] Mix factor for extruder stepper 5
I[factor] Mix factor for extruder stepper 6
  • Set multiple mix factors for a mixing extruder.
  • Factors that are left out will be set to 0.
  • All factors together must add up to 1.0.

M190: Wait for bed temperature to reach target temp

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No Yes Yes M116 Yes
Parameters
Snnn minimum target temperature, waits until heating
Rnnn accurate target temperature, waits until heating and cooling (Marlin and Prusa)
Example
M190 S60

Wait for the bed temperature to reach 60 degrees, printing out the temperatures once per second.

M191: Wait for chamber temperature to reach target temp

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
2.0.0+ 1.17+ No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No Yes No No No
Example
M191 S60

Set the temperature of the build chamber to 60 °C and wait for the temperature to be reached.

Parameters
Snnn minimum target temperature, waits until heating
Rnnn accurate target temperature, waits until heating and cooling (Marlin)

M200: Set filament diameter

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes 1.19+ Yes Yes ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No Yes No No No

RepRapFirmware:

Parameters
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.
Daaa Sets filament diameter (or disables volumetric extrusion) for all extruders
Examples
M200 D0  ; disable volumetric extrusion on all extruders
M200 D1.75  ; set al extruder filament diameters to 1.75mm
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

Volumetric extrusion is an option you can set in some slicers whereby all extrusion amounts are specified in mm3 (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.

Sending M200 without parameters reports the current volumetric extrusion state and (where appropriate) filament diameter for each extruder.

Note that if you use slicer-commanded retraction, the retraction amounts must be specified in mm3 too. If instead you use firmware retraction, then the firmware retraction amounts specified using the M207 command are still interpreted as mm.

Other firmwares:

Without parameters loads default grid, and with specified extension attempts to load the specified grid. If not available will not modify the current grid. If Z was saved with the grid file, it will load the saved Z with the grid.

M200 Dm.mmm 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.)

M200 D0 or M200 D1.128 ; reset E multiplier to 1, since sqrt(1 / pi) * 2 = 1.128

See also Gcode#M119:_Get_Endstop_Status

Question: what does a firmware do with filament diameter? Has this an effect on how much an E command moves the extruder motor? --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. DaveX (talk) 16:44, 12 April 2014 (PDT) Smoothie implements the same thing as Marlin --Arthurwolf (talk) 05:23, 10 November 2014 (PST)

M201: Set max printing acceleration

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes No ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No Yes No No
Parameters
Xnnn Acceleration for X axis
Ynnn Acceleration for Y axis
Znnn Acceleration for Z axis
Ennn Acceleration for extruder drives
Example
M201 X1000 Y1000 Z100 E2000

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.

RepRapFirmware expects these values to be in mm/s².

M202: Set max travel acceleration

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No Yes No ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No No No No

Set max travel acceleration in units/s^2 for travel moves (M202 X1000 Y1000). Unused in Marlin!!

M203: Set maximum feedrate

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No No No No
Parameters
Xnnn Maximum feedrate for X axis
Ynnn Maximum feedrate for Y axis
Znnn Maximum feedrate for Z axis
Ennn Maximum feedrate for extruder drives
Example
M203 X6000 Y6000 Z300 E10000

Sets the maximum feedrates that your machine can do in mm/min (Marlin uses mm/sec).

M203: Set temperature monitor
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

Set temperature monitor to Sx. Repetier Firmware only.

M204: Set default acceleration

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes 1.18+ Yes Yes ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No No No No
Parameters (RepRapFimware)
Pnnn Acceleration for printing moves
Tnnn Acceleration for travel moves
Example
M204 P500 T2000

Use M201 to set per-axis accelerations and extruder accelerations. RepRapFirmware applies the M204 accelerations to the move as a whole, and also applies the limits set by M201 to each axis and extruder.

Parameters (MK4duo)
Pnnn Acceleration for printing moves
Vnnn Acceleration for travel moves
Rnnn Acceleration for Retraction for Tools with T code
Example
M204 P500 V2000 T0 R5000

Other firmwares:

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 M20 minimum feedrate

Marlin notes: After Mar11-2015, the M204 options have changed in Marlin:

P = Printing moves

R = Retract only (no X, Y, Z) moves

T = Travel (non printing) moves

The command M204 P800 T3000 R9000 sets the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.

M204 Repetier
Usage
M204 X[Kp] Y[Ki] Z[Kd]

Set PID parameter. Values are 100*real value.

M205: Advanced settings

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes M566 Yes Yes ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No No No No
Sprinter / Marlin
Minimum travel speed = S[printing] T[travel]
B[min segment time] X[max XY jerk] Z[max Z jerk] E[max E jerk]
Sprinter / Marlin Example
M205 X30 Z5 ; Set X/Y Jerk to 30mm/s, Z jerk to 5mm/s

Smoothieware uses a different algorithm: [1]

X[xy junction deviation] Z[z junction deviation] S[minimum planner speed].
Z junction deviation only applies to z only moves
0 disables junction deviation for Z
-1 uses global junction deviation
Smoothie example
M205 X0.05  ; set X/Y Junction Deviation
M205: EEPROM Report
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

Output EEPROM settings. Repetier Firmware only.

M206: Offset axes

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes No Yes ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No Yes No No
Parameters
Xnnn X axis offset
Ynnn Y axis offset
Znnn Z axis offset
Example
M206 X10.0 Y10.0 Z-0.4

The values specified are added to the endstop position when the axes are referenced. The same can be achieved with a G92 right after homing (G28, G161).

With Marlin firmware, this value can be saved to EEPROM using the M500 command.

A similar command is G10, aligning these two is subject to discussion.

With Marlin 1.0.0 RC2 a negative value for z lifts(!) your printhead.

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.

M206: Set EEPROM value
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

Set a Repetier Firmware EEPROM value.

Parameters
T[type] Value type
P[pos] Value position
[S(long)] An integer value
[X(float)] A float value
Example
M206 T3 P39 X19.9 ; Set Jerk to 19.9

M207: Firmware dependent

M207: Set retract length
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes No Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No Yes No No Yes
Parameters
Snnn positive length to retract, in mm
Rnnn positive or negative additional length to un-retract, in mm (RepRapFirmware only)
Fnnn retraction feedrate, in mm/min
Tnnn feedrate for un-retraction if different from retraction, mm/min (RepRapFirmware 1.16 and later only)
Znnn additional zlift/hop
Example
M207 S4.0 F2400 Z0.075

Set the retract length used by the G10 and G11 commands. Units are in mm regardless of M200 setting.

Machinekit uses different parameters and speed units for M207. Use P to set retract length in mm. Use Q to set retract velocity in mm/s. For firmware retraction Machinekit uses G22 and G23 in place of G10 and G11.

M207: Calibrate Z axis with Z max endstop
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Use G1 S3 ... No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M207

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.

This procedure is usually more reliable than mechanical adjustments of a Z MIN endstop.

M207: Set jerk without saving to EEPROM
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No M566 Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No ??? No ??? No No ??? No

Repetier Firmware only. Change the maximum instantaneous speed change ("jerk") values, but don't store the change in EEPROM.

Since Repetier 0.91 December 2013 [2] (if not earlier)

Parameters
Xnnn Temporarily set XY jerk in mm/s
Znnn Temporarily set Z jerk in mm/s
Ennn Temporarily set Extruder jerk in mm/s
Example
M207 X10  ; Change the X/Y Jerk to 10mm/s

M208: Set axis max travel

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Snnn 0 = set axis maximum (default), 1 = set axis minimum
Xnnn X axis limit
Ynnn Y axis limit
Znnn Z axis limit
Example
M208 X200 Y200 Z90 ; set axis maxima
M208 X-5 Y0 Z0 S1 ; set axis minima

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.

M208: Set unretract length

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Use M207 No Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Snnn positive length surplus to the M207 Snnn, in mm
Fnnn feedrate, in mm/sec

Sets recover=unretract length.

M209: Enable automatic retract

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No Yes No ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M209 S1

This boolean value S 1=true or 0=false enables automatic retract detect if the slicer did not support G10/G11: every normal extrude-only move will be classified as retract depending on the direction.

M210: Set homing feedrates

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M210 X1000 Y1500

Set the feedrates used for homing to the values specified in mm per minute.

M211: Disable/Enable software endstops

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Use M564 No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

The boolean value S 1=enable or 0=disable controls state of software endstop.

The boolean value X, Y or Z 1=max endstop or 0=min endstop selects which endstop is controlled.

Example
M211 X1 Y1 Z1 S0

Disables X,Y,Z max endstops

Example
M211 X0 S1

Enables X min endstop

Example
M211

Prints current state of software endstops.

M212: Set Bed Level Sensor Offset

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Partial* Use G31 No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

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.

Example
M212 Z-0.2

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.

PrintrBot suggests that the user make minor (0.1-0.2) adjustments between attempts and immediately executes M500 & M501 after setting this.

M217: Toolchange Parameters

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

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 SINGLENOZZLE tool-change options in Marlin 2.0 and up. May be extended for other tool-changing systems in the future.

M218: Set Hotend Offset

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Use G10 No No ??? Yes1 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

Sets hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>.

Example
M218 T1 X50 Y0.5
Notes

In Prusa Firmware this G-code is only active if EXTRUDERS is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.1

M220: Set speed factor override percentage

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No Yes Yes No
Parameters
Snnn Speed factor override percentage (0..100 or higher)
Example
M220 S80

Sets the speed factor override percentage.

M221: Set extrude factor override percentage

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes1 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No Yes Yes No
Parameters
Snnn Extrude factor override percentage (0..100 or higher), default 100%
Dnnn Extruder drive number (RepRapFirmware only), default 0
Tnnn Extruder drive number (Prusa Firmware only), default 0 if not set.1
Example
M221 S70
M221 S95 D1
M221 S85 T1

Sets extrude factor override percentage. In the case of RepRapFirmware and Prusa Firmware, sets the extrusion factor percentage for the specified extruder drive only.

M220: Turn off AUX V1.0.5

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

M221: Turn on AUX V1.0.5

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

M222: Set speed of fast XY moves

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

M223: Set speed of fast Z moves

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

M224: Enable extruder during fast moves

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

M225: Disable on extruder during fast moves

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No No No No No

M226: G-code Initiated Pause

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No Yes No Yes No No No
Example
M226

Initiates a pause in the same way as if the pause button is pressed. That is, program execution is stopped and the printer waits for user interaction. This matches the behaviour of M1 in the NIST RS274NGC G-code standard and M0 in Marlin firmware.

M226: Wait for pin state

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes see M577 Yes No ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Pnnn pin number
Snnn pin state
Example
M226 P2 S1

Wait for a pin to be in some state.

M227: Enable Automatic Reverse and Prime

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M227 P1600 S1600

P and S are steps.

"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 M101/M103.

M228: Disable Automatic Reverse and Prime

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M228

See also M227.

M229: Enable Automatic Reverse and Prime

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M229 P1.0 S1.0

P and S are extruder screw rotations. See also M227.

M230: Disable / Enable Wait for Temperature Change

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M230 S1

S1 Disable wait for temperature change S0 Enable wait for temperature change

M231: Set OPS parameter

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[RetractMove]

M232: Read and reset max. advance values

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No

M240: Trigger camera

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? No1 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M240

Triggers a camera to take a photograph. (Add to your per-layer G-code.)

Notes

In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.1

M240: Start conveyor belt motor / Echo off

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No Debug: Echo off No
Example
M240

The conveyor belt allows to start mass production of a part with a reprap.

Echoing may be controlled in some firmwares with M111.

M241: Stop conveyor belt motor / echo on

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No Debug: Echo on No
Example
M241

Echoing may be controlled in some firmwares with M111.

M245: Start cooler

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Use M106 No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M245

used to cool parts/heated-bed down after printing for easy remove of the parts after print

M246: Stop cooler

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Use M106 No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M246

M250: Set LCD contrast

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M250 C20

Sets LCD contrast C<contrast value> (value 0..63), if available.

M251: Measure Z steps from homing stop (Delta printers)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Examples
M251 S0 ; Reset
M251 S1 ; Print
M251 S2 ; Store to Z length (also EEPROM if enabled)

(This is a Repetier-Firmware only feature.)

M260: i2c Send Data

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.0+ 1.21+ No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

Buffer and send data over the i2c bus. Use A to set the address from 0-127. Add up to 32 bytes to the buffer with each B. Send and reset the buffer with S.

Parameters (Marlin, MK4duo)
Ann I2C address
Bnn Byte to buffer or send
S If present, sends the bytes that have been buffered
Examples
M260 A5 B65 S ; Send 'A' to Address 5 now
M260 A0       ; Set address to 0 (broadcast)
M260 B77  ; M
M260 B97  ; a
M260 B114 ; r
M260 B108 ; l
M260 B105 ; i
M260 B110 ; n
M260 S1   ; Send the current buffer
Parameters (RepRapFirmware)
Ann I2C address
Bnn:nn:nn... Bytes to send
Snn Number of bytes to receive (optional, RepRapFirmware 2.02RC4 and later)
Examples
M260 A5 B65                    ; Send 'A' to address 5
M260 A"0x7F" B65               ; Send 'A' to address 7F (hex)
M260 A0 B82:101:112:82:97:112  ; Send 'RepRap' to address 0

RepRapFirmware does not use the S parameter, instead the address and all the bytes to send are specified in a single command.

M261: i2c Request Data

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.0+ 1.21+ No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

Request data from an i2c slave device. This command simply relays the received data to the host.

Parameters
Ann I2C address
Bnn How many bytes to request
Example
M261 A99 B5 ; Request 5 bytes from Address 99

Both M260 and M261 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 EXPERIMENTAL_I2CBUS, and Marlin can act as a slave device by setting I2C_SLAVE_ADDRESS 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.

M280: Set servo position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes 1.16+ Use M340 No ??? No1 Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No Yes Yes No No

Set servo position absolute.

Parameters
Pnnn Servo index
Snnn Angle or microseconds
I1 Invert polarity (RepRapFirmware only)
Example
M280 P1 S50

Marlin and RepRapFirmware treat S values below 200 as angles, and 200 or greater as the pulse width in microseconds.

In RepRapFirmware, the servo index is the same as the pin number for the M42 command. See https://duet3d.com/wiki/Using_servos_and_controlling_unused_I/O_pins for details.

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 I parameter is not remembered between M280 commands (unlike the I parameter in M106 commands), so if you need inverted polarity then you must include I1 in every M280 command you send.

Duet 0.8.5 M280 P value to Expansion Port Pin Mapping
P Name Expansion Port Pin
Use M307 H# A-1 C-1 D-1 before using these pins
3 PC23_PWML6 21
4 PC22_PWML5 22
5 PC21_PWML4 23

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 (M106 P1 I-1). See Using servos and controlling unused I/O pins

Notes

In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.1

M290: Babystepping

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.7+ 1.18+ Yes No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters (RepRapFirmware)
Snnn Amount to baby step in mm. Positive values raise the head, negative values lower it.
Znnn Synonym for S (RepRapFirmware 1.21 and later)
Rn (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)
Examples
M290 S0.05  ; babystep the head up 0.05mm
M290 R0 S0  ; clear babystepping (RepRapFirmware 1.21 and later only)
Parameters (Repetier)
Znnn Amount to baby step in mm. Positive values raise the head, negative values lower it.
Examples
M290 S0.05  ; babystep the head up 0.05mm
Additional Parameters (Marlin 1.1.7 and later)
Xnnn Amount to babystep X in current units. (Requires BABYSTEP_XY)
Ynnn Amount to babystep Y in current units. (Requires BABYSTEP_XY)
Znnn Amount to babystep Z in current units. Synonym for 'S' parameter.
Example
M290 X0.2 Z0.05 ; Babystep X by 0.2mm, Z by 0.05mm

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.

In RepRapFirmware M290 with no parameters reports the accumulated baby stepping offset. Marlin doesn't track accumulated babysteps.

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.

Note: If the BABYSTEP_ZPROBE_OFFSET option is used in Marlin, this command also affects the Z probe offset (as set by M851) and that offset will be saved to EEPROM.

M291: Display message and optionally wait for response

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.19+ No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
P"message" 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.
R"message" Optional title for the message box. Must be enclosed in double quotation marks too.
Sn Message box mode (defaults to 1)
Tn 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.
Zn 0 = no special action, 1 = display Z jog buttons alongside the message to allow the user to adjust the height of the print head
Examples
M291 P"Please do something and press OK when done" S2
M291 P"This message will be closed after 10 seconds" T10

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.

Allowed message box modes include:

0. No buttons are displayed (non-blocking)
1. Only "Close" is displayed (non-blocking)
2. Only "OK" is displayed (blocking, send M292 to resume the execution)
3. "OK" and "Cancel" are displayed  (blocking, send M292 to resume the execution or M292 P1 to cancel the operation in progress)

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.

Duet Web Control 2.0.3 and later supports HTML in the message body.

M292: Acknowledge message

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.19+ No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Pn Whether the current operation shall be cancelled. Only legal if M291 was called with S=3 (optional)

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.

M300: Play beep sound

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes No ??? Yes1 Yes Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No Yes No No No
Parameters
Snnn frequency in Hz
Pnnn duration in milliseconds
Example
M300 S300 P1000

Play beep sound, use to notify important events like the end of printing. See working example on R2C2 electronics.

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.

Notes

In Prusa Firmware the defaults are 100Hz and 1000ms, so that M300 without parameters will beep for a second.

M301: Set PID parameters

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No Yes See M130-M133 No
Parameters
Hnnn heater number (Smoothie uses 'S', Redeem uses 'E')
Pnnn proportional (Kp)
Innn integral (Ki)
Dnnn derivative (Kd)
Examples
M301 H1 P1 I2 D3 ; Marlin, RepRapFirmware
M301 S0 P30 I10 D10 ; Smoothie
M301 E0 P30 I10 D10 ; Redeem (E = Extruder, -1=Bed, 0=E, 1=H, 2=A, 3=B, 4=C, default = 0)

Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also PID Tuning.

MK4duo

H[heaters] H = 0-5 Hotend, H = -1 BED, H = -2 CHAMBER, H = -3 COOLER

Marlin

Hot end only; see M304 for bed PID. H is the heater number, default 1 (i.e. first extruder heater).

RepRapFirmware 1.15 onwards

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.

RepRapFirmware 1.09 to 1.14 inclusive
  • H Is the heater number, and is compulsory. H0 is the bed, H1 is the first hot end, H2 the second etc.
  • P 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).
  • I Integral value
  • D Derivative value
  • T 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.
  • S 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.
  • W Wind-up. Sets the maximum value of I-term, must be high enough to reach 245C for ABS printing.
  • B PID Band. Errors larger than this cause heater to be on or off.

An example using all of these would be:

M301 H1 P20 I0.5 D100 T0.4 S1 W180 B30
Smoothie

S0 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.

Other implementations

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?)

Example
M301 W125
Teacup

See M130, M131, M132, M133 for Teacup's codes for setting the PID parameters.

M302: Allow cold extrudes

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes1 0.92+ No ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Parameters
Snnn Cold extrude minimum temperature (also in RepRapFirmware 2.02 and later)
Pnnn Cold extrude allow state (RepRapFirmware)
Rnnn Cold retraction minimum temperature (RepRapFirmware 2.02 and later)
Examples (RepRapFirmwre)
M302       ; Report current state
M302 P1    ; Allow cold extrusion
M302 S120 R110 ; Allow extrusion starting from 120°C and retractions already from 110°C
Examples (Others)
M302 S0    ; Allow extrusion at any temperature
M302 S170  ; Allow extrusion above 170

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.

Notes

1RepRapFirmware uses the P[0|1] parameter instead of S[temperature], and for M302 with no parameters it will report the current cold extrusion state.

M303: Run PID tuning

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes 1.15+ Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No Yes No No

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.

Hot end usage:

M303 S<temperature> C<cycles>

Bed usage (repetier, not sure whether cycles work here):

M303 P1 S<temperature>

Bed usage (others):

M303 E-1 C<cycles> S<temperature>
Example
M303 C8 S175

Smoothie's syntax, where E0 is the first temperature control module (usually the hot end) and E1 is the second temperature control module (usually the bed):

M303 E0 S190

In RepRapFirmware, this command computes the process model parameters (see M307), 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 M303 with no parameters to see the current tuning state or the last tuning result.

Example
M303 H1 P0.4 S240 ; tune heater 1 using 40% PWM, quit if temperature exceeds 240C
Notes

In Marlin Firmware you can add the U1 parameter to apply the PID results to current settings upon completion.

M304: Set PID parameters - Bed

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes ??? M301 ??? Yes M301 ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No ???
Parameters
Pnnn proportional (Kp)
Innn integral (Ki)
Dnnn derivative (Kd)
Examples
M304 P1 I2 D3 ; set kP=3, kI=2, kD=3
M304 P1 I2 D3 T0.7 B20 W127 ; RepRapFirmware
M304          ; Report parameters

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 M301 except that the H parameter (heater number) defaults to zero.

See also PID Tuning.

M304 in RepRapPro version of Marlin: Set thermistor values

In the RepRapPro version of Marlin ( https://github.com/reprappro/Marlin ) M304 is used to set thermistor values (as M305 is in later firmwares). RRP Marlin calculates temperatures on the fly, rather than using a temperature table. M304 Sets the parameters for temperature measurement.

Example
M304 H1 B4200 R4800 T100000

This tells the firmware that for heater 1 (H parameter: 0 = heated bed, H = first extruder), the thermistor beta (B parameter) is 4200, the thermistor series resistance (R parameter) is 4.8Kohms, the thermistor 25C resistance (T parameter) is 100Kohms. All parameters other than H are optional. If only the H parameter is given, the currently-used values are displayed. They are also displayed within the response to M503.

M305: Set thermistor and ADC parameters

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes ??? Yes ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Pnnn Heater number, or virtual heater number
S"name" Heater name (optional, RepRapFirmware only)
Tnnn (for thermistor sensors) Thermistor resistance at 25oC
T"c" (for MAX31856-based thermocouple sensors) The thermistor type letter, default K
Bnnn Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient
Cnnn Steinhart-Hart C coefficient (MK4duo and RepRapFirmware 1.17 and later), default 0
Rnnn Series resistor value
Lnnn ADC low offset correction, default 0
Hnnn ADC high offset correction, default 0
Xnnn Heater ADC channel, or thermocouple or PT100 or current loop adapter channel, defaults to the same value as the P parameter
Fnn (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.
Example
M305 P1 T100000 R1000 B4200

Sets the parameters for temperature measurement. The example above tells the firmware that for heater 1 (P parameter: 0 = heated bed, 1 = first extruder) the thermistor 25C resistance (T parameter) is 100Kohms, the thermistor series resistance (R parameter) is 1Kohms, the thermistor beta (B parameter) is 4200. All parameters other than P are optional. If only the P parameter is given, the existing values are displayed.

Example
M305 P1 T100000 R1000 B4200 H14 L-11 X2

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.

The X 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.

In the above example, the ADC high end correction (H parameter) is 14, the ADC low end correction (L parameter) is -11, and thermistor input #2 is used to measure the temperature of heater #1.

M306: Set home offset calculated from toolhead position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Example
M306 Z0

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.

The user would typically place the toolhead at the zero point of the axis and issue the M306 command.

This value can be saved to EEPROM using the M500 command (as M206 value).

Implemented in Smoothieware

M307: Set or report heating process parameters

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.15+ No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Hn Heater number (0 is usually the bed heater)
Annn 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.
Cnnn dominant time Constant of the heating process in seconds
Dnnn Dead time in seconds
Four optional additional parameters help control the heating process
Fnnn PWM frequency to use (not supported in RepRapFirmware 3, use M950 instead).
Bn 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.
Snnn maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.
Vnnn 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.
Examples
M307 H0 ; report the process parameters for heater 0
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%

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 M303.

RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the A, C, and D 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.

M308: Set or report sensor parameters

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 3.0+ No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Common Parameters
Sn Sensor number
P"pin_name" 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.
Y"sensor_type" The sensor and interface type, e.g. "thermistor", "pt1000", "rtdmax31865", "max31855", "max31856", "linear-analog", "dht22-temp", "dht22-humidity", "current-loop-pyro"
A"name" Sensor name (optional), displayed in the web interface
Additional parameters for thermistors
Tnnn (for thermistor sensors) Thermistor resistance at 25oC
Bnnn Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient
Cnnn Steinhart-Hart C coefficient, default 0
Rnnn Series resistor value
Lnnn ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)
Hnnn ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)
Additional parameters for PT1000 sensors
Rnnn Series resistor value
Lnnn ADC low offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)
Hnnn ADC high offset correction, default 0 (ignored if the hardware supports automatic ADC gain and offset calibration)
Additional parameters for MAX31856-based thermocouple sensors
T"c" The thermistor type letter, default K
Fnn (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.
Additional parameters for MAX31865-based PT100 sensors
Rnnn Series resistor value
Fnn (where nn is 50 or 60) The local mains frequency. Readings will be timed to optimise rejection of interference at this frequency.
Additional parameters for linear analog sensors
Fn F0 = unfiltered (fast response), F1 = filtered (slower response, but noise reduced and ADC oversampling used to increase resolution)
Lnnn The temperature or other value when the ADC output is zero
Hnnn The temperature or other value when the ADC output is full scale

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.

M308 can be used in the following ways:

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
M308 Snn ; report the settings of sensor nn
M308 A"name" ; report the settings of the first sensor named "name"
M308 Snn [any other parameters except Y] ; amend the settings of sensor nn

Sensor type names obey the same rules as pin names, i.e. case is not significant, neither are hyphen and underscore characters.

M320: Activate autolevel (Repetier)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M320
M320 S1
Parameters
Snnn if greater than 0, activate and store persistently in EEPROM
Examples
M320    ; temporarily activate auto leveling
M320 S1 ; permanently activate auto leveling

Parameter Snnn is optional.

(Repetier only)

M321: Deactivate autolevel (Repetier)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M321
M321 S1
Parameters
Snnn if greater than 0, deactivate and store persistently in EEPROM
Examples
M321    ; temporarily deactivate auto leveling
M321 S1 ; permanently deactivate auto leveling

Parameter Snnn is optional.

(Repetier only)

M322: Reset autolevel matrix (Repetier)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M322
M322 S1
Parameters
Snnn if greater than 0, also reset the matrix values saved EEPROM
Examples
M322    ; temporarily reset auto level matrix
M322 S1 ; permanently reset auto level matrix

Parameter Snnn is optional.

(Repetier only)

M323: Distortion correction on/off (Repetier)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M323
M323 Snnn
M323 Snnn Pnnn
Parameters
Snnn 0 (disable correction) or 1 (enable correction)
Pnnn 1 (store correction state persistently in EEPROM)
Examples
M323       ; Show if distortion correction is enabled
M323 S0    ; Disable distortion correction temporarily
M323 S1 P1 ; Enable distortion correction permanently

(Repetier only) Controls distortion correction feature after having set it up using G33.

M340: Control the servos

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

(Repetier only ,Marlin see M280)

M340 P<servoId> S<pulseInUS> / ServoID = 0..3 pulseInUs = 500..2500

Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.

M350: Set microstepping mode

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes No ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No Yes No No

Sets microstepping mode.

Warning: Steps per unit remains unchanged; except that in RepRapFirmware the steps/mm will be adjusted automatically.

Usage
M350 Snn Xnn Ynn Znn Enn Bnn
Parameters
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.
Snn Set stepping mode for all drivers (not supported by RepRapFirmware)
Xnn Set stepping mode for the X axis
Ynn Set stepping mode for the Y axis
Znn Set stepping mode for the Z axis
Enn Set stepping mode for Extruder 0 (for RepRapFirmware use Enn:nn:nn etc. for multiple extruders)
Bnn Set stepping mode for Extruder 1 (not supported by RepRapFirmware, see above)
Inn Enable (nn=1) or disable (nn=0) microstep interpolation mode for the specified drivers, if they support it (RepRapFirmware only)
Modes (nn)
1 = full step
2 = half step
4 = quarter step
8 = 1/8 step
16 = 1/16 step
64 = 1/64 step
128 = 1/128 step
256 = 1/256 step
Examples
M350 S16    ; reset all drivers to the default 1/16 micro-stepping - not supported by RepRapFirmware
M350 Z1     ; set the Z-axis' driver to use full steps
M350 E4 B4  ; set both extruders to use quarter steps - Marlin/Repetier
M350 E4:4:4 ; set extruders 0-2 to use quarter steps - RepRapFirmware

M351: Toggle MS1 MS2 pins directly

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No No No No
Example
M351

M355: Turn case lights on/off

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.0+ No 0.92.2+ No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No use M106 No
Examples
M355 S1 ; Enable lights
M355 S0 ; Disable lights
M355    ; Report status

Every call or change over LCD menu sends a state change for connected hosting software like:

Case lights on
Case lights off
No case lights

M360: Report firmware configuration

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M503 No 0.92.2+ No ??? M503 No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Target

This command helps hosting software to detect configuration details, which the user would need to enter otherwise. It should reduce configuration time considerably if supported.

Example
M360
Response
Config:Baudrate:250000
Config:InputBuffer:127
Config:NumExtruder:2
Config:MixingExtruder:0
Config:HeatedBed:0
Config:SDCard:1
Config:Fan:1
Config:LCD:1
Config:SoftwarePowerSwitch:1
Config:XHomeDir:-1
Config:YHomeDir:-1
Config:ZHomeDir:-1
Config:SupportG10G11:1
Config:SupportLocalFilamentchange:1
Config:CaseLights:0
Config:ZProbe:1
Config:Autolevel:0
Config:EEPROM:1
Config:PrintlineCache:24
Config:JerkXY:30.00
Config:JerkZ:0.30
Config:RetractionLength:3.00
Config:RetractionLongLength:13.00
Config:RetractionSpeed:40.00
Config:RetractionZLift:0.00
Config:RetractionUndoExtraLength:0.00
Config:RetractionUndoExtraLongLength:0.00
Config:RetractionUndoSpeed:0.00
Config:XMin:0.00
Config:YMin:0.00
Config:ZMin:0.00
Config:XMax:250.00
Config:YMax:150.00
Config:ZMax:90.00
Config:XSize:250.00
Config:YSize:150.00
Config:ZSize:90.00
Config:XPrintAccel:250.00
Config:YPrintAccel:250.00
Config:ZPrintAccel:100.00
Config:XTravelAccel:250.00
Config:YTravelAccel:250.00
Config:ZTravelAccel:100.00
Config:PrinterType:Cartesian
Config:MaxBedTemp:120
Config:Extr.1:Jerk:50.00
Config:Extr.1:MaxSpeed:100.00
Config:Extr.1:Acceleration:10000.00
Config:Extr.1:Diameter:0.00
Config:Extr.1:MaxTemp:220
Config:Extr.2:Jerk:50.00
Config:Extr.2:MaxSpeed:100.00
Config:Extr.2:Acceleration:10000.00
Config:Extr.2:Diameter:0.00
Config:Extr.2:MaxTemp:220

SCARA calibration codes (Morgan)

In order to ease calibration of Reprap Morgan, the following M-codes are used to set the machine up

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Partial No No Yes ??? No Partial No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No ???

M360: Move to Theta 0 degree position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No Yes ??? No Experimental No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No ???

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 M114 will then display the calibration offset that can then be programmed into the unit using M206 (Home offset) X represents Theta.

Smoothieware: M360 P0 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.

M361: Move to Theta 90 degree position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No Yes ??? No Experimental No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No ???

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 M114, and programmed using M92. X represents Theta. Program Y (Psi) to the same value initially. Remember to repeat M360 after adjusting steps per degree.

Smoothieware: M360 P0 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 M360.

M362: Move to Psi 0 degree position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No Yes ??? No Experimental No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No ???

Arms move to Psi 0 degree. Check only after other Theta calibrations

M363: Move to Psi 90 degree position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No Yes ??? No Experimental No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No ???

Arms move to Psi 90 degree. Check only after other Theta calibrations

M364: Move to Psi + Theta 90 degree position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No Yes ??? No Experimental No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No ???

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 M114, and calibrate value into Home offset M206. Psi is represented by Y.

Smoothieware: M364 P0 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 M500.

M365: SCARA scaling factor

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Use M579 No Yes ??? No Experimental No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No ???

Adjust X Y and Z scaling by entering the factor. 100% scaling (default) is represented by 1

M366: SCARA convert trim

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

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.

M370: Morgan manual bed level - clear map

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Use M557 No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

Clear the map and prepare for calibration

Usage
M370
M370 X[divisions] Y[divisions]

Without parameters is defaults to X5 Y5 (25 calibration points) When specifying parameters, uneven numbers are recommended.

M371: Move to next calibration position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No

Move to the next position for calibration. User moves the bed towards the hotend until it just touches

M372: Record calibration value, and move to next position

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No

The position of the bed is recorded and the machine moves to the next position. Repeat until all positions programmed

M373: End bed level calibration mode

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No

End calibration mode and enable z correction matrix. Does not save current matrix

M374: Save calibration grid

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.17+ No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No

Saves the calibration grid.

Parameters
extension (Smoothieware only) Extension of the grid file
Pfilename (RepRapFirmware only) Name of the file to save to
Z (Smoothieware only) Also save the M206 Z homing offset into the grid file
Usage (Smoothieware)
M374
M374 <file extension> Z
Usage (RepRapFirmware)
M374
M374 PMyAlternateHeightMap.csv

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 M206 Z homing offset into the grid file.

In RepRapFirmware, this saves the grid parameters and height map into the specified file, or the default file heightmap.csv if no filename was specified. To load the height map automatically at startup, use command M375 in the config.g file.

M375: Display matrix / Load Matrix

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.17+ No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No

Displays the bed level calibration matrix (Marlin), or loads the grid matrix file (Smoothieware and RepRapFirmware)

Parameters
extension (Smoothieware only)
Pfilename (RepRapFirmware only)
Usage
M375
M375 [file extension] ; (Smoothieware only)
M375 PMyAlternateHeightMap.csv ; (RepRapFirmware only)

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. In Smoothieware, if Z was saved with the grid file, it will load the saved Z with the grid.

M376: Set bed compensation taper

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M420Z 1.17+ No Yes ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Parameters
Hnnn Height (mm) over which to taper off the bed compensation
Example
M376 H10

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.

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%.

M380: Activate solenoid

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No ??? No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Example
M380

Activates solenoid on active extruder.

M381: Disable all solenoids

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No ??? No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Example
M381

M400: Wait for current moves to finish

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No Yes ??? use G4 No
Example
M400

Finishes all current moves and and thus clears the buffer. That's identical to G4 P0 for Teacup printers.

M401: Lower z-probe

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes 1.17+ ??? No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Example
M401

Lower z-probe if present. In RepRapFirmware this runs macro file sys/deployprobe.g.

M402: Raise z-probe

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes 1.17+ ??? No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Example
M402

Raise z-probe if present. In RepRapFirmware this runs macro file sys/retractprobe.g.

M403: Set filament type (material) for particular extruder and notify the MMU

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
??? ??? ??? ??? ??? Yes ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? ??? ??? ??? ??? ??? ??? ???
Parameters
E Extruder number
F Filament type

Currently three different materials are needed (default, flex and PVA).

And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.

M404: Filament width and nozzle diameter

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Parameters
Nnnn Filament width (in mm)
Dnnn Nozzle diameter (in mm)1
Examples
M404 N1.75
M404 N3.0 D1.0

Enter the nominal filament width (3mm, 1.75mm) or will display nominal filament width without parameters.

Notes

1While 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.

M405: Filament Sensor on

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Use M591 No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Example
M405

Turn on Filament Sensor extrusion control. Optional D<delay in cm> to set delay in centimeters between sensor and extruder.

M406: Filament Sensor off

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Use M591 No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Example
M406

Turn off Filament Sensor extrusion control.

M407: Display filament diameter

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes No No ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
Example
M407

Displays measured filament diameter. In RepRapFirmware, M407 does the same as M404.

M408: Report JSON-style response

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Snnn Response type
Rnnn Response sequence number
Example
M408 S0

Report a JSON-style response by specifying the desired type using the 'S' parameter.

The following response types are supported:

  • Type 0 is a short-form response, similar to the response used by older versions of the web interface.
  • Type 1 is like type 0 except that static values are also included.
  • Type 2 is similar to the response provided by the web server for Duet Web Control.
  • Type 3 is an extended version of type 2 which includes some additional parameters that aren't expected to change very frequently.
  • Type 4 is an extended version of type 2 which may be used to poll for current printer statistics.
  • Type 5 reports the current machine configuration.

Here is an example of a typical type 0 response:

{"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],
 "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}

The response is set as a single line with a newline character at the end. The meaning of the fields is:

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
heaters: current heater temperatures, numbered as per the machine (typically, heater 0 is the bed)
active:  active temperatures of the heaters
standby: standby temperatures of the heaters
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.
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
extr:    the positions of the extruders
sfactor: the current speed factor (see M220 command)
efactor: the current extrusion factors (see M221 command), one value per extruder
tool:    the selected tool number. A negative number typically means no tool selected.
probe:   the Z-probe reading
fanPercent: the speeds of the controllable fans, in percent of maximum
fanRPM:  the print cooling fan RPM
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.
fraction_printed: the fraction of the file currently being printed that has been read and at least partially processed.
message: the message to be displayed on the screen (only present if there is a message to display)
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,
           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.
seq:     the sequence number of the most recent non-trivial G-code response or error message. Only present if the R parameter was provided and the current sequence number is greater than that.
resp:    the most recent non-trivial G-code response or error message. Only present if the R parameter was provided and the current sequence number is greater.

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:

myName:  the name of the printer
firmwareName: the name of the firmware, e.g. "RepRapFirmware", "Smoothieware" or "Repetier"
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.
axes:    the number of axes
volumes: the number of SD card slots available
numTools:   the number of available tools numbered contiguously starting from 0

The fields may be in any order in the response. Other implementations may omit fields and/or add additional fields.

For a more detailed comparison of type 2 - 5, see RepRap_Firmware_Status_responses.

PanelDue currently uses only M408 S0 and M408 S1.

M410: Quick-Stop

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.0-RC2+ Use M112 No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No

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.

M412: Disable Filament Runout Detection

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
2.0+ Use M591 No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

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 M600 Filament Change). When filament runout detection is disabled, no action will be taken on filament runout.

Usage: M412 S[on|off]

If no 'S' parameter if given, this command reports the current state of filament runout detection.

Examples
M412 S1 Enable filament runout detection
M412 S0 Disable filament runout detection
M412 Report the current filament runout detection state

M413: Power-Loss Recovery

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
2.0+ Use M911 No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

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 POWER_LOSS_RECOVERY option must be enabled.

This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a POWER_LOSS_PIN 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.)

Usage: M413 S[on|off]

If no 'S' parameter if given, this command reports the current state of Power-loss Recovery.

Examples
M413 S1 Enable power-loss recovery
M413 S0 Disable power-loss recovery
M413 Report the current power-loss recovery state

M415: Host Rescue

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

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.

If the firmware supports this solution it should announce it with the capability: Cap:HOST_RESCUE:1

Examples
M415 S1 Enable host rescue system
M415 S0 Disable host rescue system
M415 Z[zpos] Set Z position as if homed
M415 Report rescue state

Every call to M415 reports the state. Answers are

RESCUE_STATE: OFF

Nothing stored. Print finished.

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

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.

On a power loss the firmware should respond with POWERLOSS_DETECTED as early as possible to give host time to flush log as it is likely host will also go down very soon.

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.

M416: Power loss

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No ??? No No

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 the message POWERLOSS_DETECTED 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.

M420: Set RGB Colors as PWM (MachineKit)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No Yes ??? No No

Usage: M420 R[Red PWM (0-255)] E[Green PWM (0-255)] B[Blue PWM (0-255)]

Example
M420 R255 E255 B255

Set the color of your RGB LEDs that are connected to PWM-enabled pins. Note, the Green color is controlled by the E value instead of the G value due to the G code being a primary code that cannot be overridden.

In Marlin M420 is Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable

M420: Leveling On/Off/Fade (Marlin)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Use G29 and M376 No No ??? ??? Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No ??? No No

Enable/Disable Bed Leveling (using the current stored grid or mesh).

Usage
M420 S[bool] Z[float]
Examples
M420 S1  ; Enable compensation using current grid/mesh
M420 Z10 ; Gradually reduce compensation until Z=10

Marlin 1.1.0 adds the Z parameter to set the "fade" height. This requires the ENABLE_LEVELING_FADE_HEIGHT option.

When the Z fade height value is set non-zero, bed compensation will gradually reduce up to the given height, and cease completely above that height.

M421: Set a Mesh Bed Leveling Z coordinate

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? ??? No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

Set a single Z coordinate in the Mesh, Bilinear or UBL Leveling grid. Requires MESH_BED_LEVELING or AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL.

I & J are the index for the X and Y axis respectively.

Usage
M421 I[index] J[index] Z[float] to set an absolute value to a mesh point

or

M421 I[index] J[index] Q[float] to offset a mesh point by a specified value

M425: Backlash Correction

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
2.0.x+ No No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Fnnn Enable/disable/fade-out backlash correction (0.0 = none to 1.0 = 100%)
Snnn Distance over which backlash correction is spread1 (mm)
Xnnn Set the backlash distance on X (mm; 0 to disable)
Ynnn Set the backlash distance on Y (mm; 0 to disable)
Znnn Set the backlash distance on Z (mm; 0 to disable)
X Use measured value for backlash on X (if available)
Y Use measured value for backlash on Y (if available)
Z Use measured value for backlash on Z (if available)
Examples (Marlin)
M425                ; Report current state
M425 Z              ; Use measured value of backlash on Z
M425 F1 S3          ; Full backlash compensation while smoothing over 3mm.
M425 F0.5 S0.0      ; Compensate for 50% of the backlash with no smoothing
M425 X0.1 Y0.2 Z0.3 ; Set backlash to specific values for all axis
Notes

1 In Marlin, backlash compensation works by adding extra steps to one or more segments after a motor direction reversal. With smoothing off, this can cause blemishes on the print. Enabling smoothing will cause those extra steps to be spread over multiple segments, minimizing artifacts.

M450: Report Printer Mode

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.20+ Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M450
Example
> M450
> PrinterMode:FFF

Printers can be used for different task by exchanging the toolhead. Depending on the tool, a different behavior of some commands can be expected. This command reports the current working mode. Possible answers are:

PrinterMode:FFF
PrinterMode:Laser
PrinterMode:CNC

M451: Select FFF Printer Mode

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.20+ Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M451
Example
> M451
> PrinterMode:FFF

Switches to FFF mode for filament printing.

M452: Select Laser Printer Mode

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.20+ Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M452
Example
> M452
> PrinterMode:Laser

Switches to laser mode. This mode enables handling of a laser pin and makes sure that the laser is only activated during G1 moves if laser was enabled or E is increasing. G0 moves should never enable the laser. M3/M5 can be used to enable/disable the laser for moves.

M453: Select CNC Printer Mode

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No 1.20+ Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M453
Parameters (RepRapFirmware only)
  • Snnn (optional) Spindle index, defaults to 0. Duet 2 supports 4 spindles max
  • 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.
  • In Invert (I1) or don't invert (I0, default) the output polarity
  • Rnnn Spindle RPM that is achieved at full PWM. Used to convert the S parameter in M3 and M4 commands to a PWM value.
  • Fnnn (optional) The PWM frequency to use
  • Tnnn (optional) Assign spindle to a tool allowing better control in DWC
Example
> M453
> PrinterMode:CNC

Switches to CNC mode. In this mode M3/M4/M5 control the pins defined for the milling device.

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).

M460: Define temperature range for thermistor-controlled fan

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Use M106 Yes No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Usage
M460 X[minTemp] Y[maxTemp]
Example
M460 X50 Y60

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.

M470: Create Directory on SD-Card

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes:2.03 No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
P"name" Name of directory to create
Usage
M470 P"directory/to/create"
Example
M470 P"/sys/config.d"

This will create a new directory on the SD-Card. If not otherwise specified the default root should be the first/internal SD-Card.

M471: Rename File/Directory on SD-Card

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes:2.03 No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
S"name" Name of existing file/directory
T"name" New name of file/directory
Dnnn Setting this to 1 will delete an existing file that matches the T parameter value
Usage
M471 S"source/name" T"dest/name" D1
Example
M471 S"/sys/config-override.g" T"/sys/config-override.g.bak"

Rename or move a file or directory. Using the D parameter can delete a file with the target name. Renaming or moving across directories is possible though not from one SD-Card to another.

M486: Cancel Object

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

The M486 G-code provides an interface to identify objects on the print bed and cancel them. Basic usage: Use M486 T 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 M486 S[index] to indicate which object is being printed. The index should be zero-based. To cancel the first object, use M486 P0; to cancel the 5th object use M486 P4; and so on. The "current" object is canceled with M486 C.

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.

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.

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).

Usage
M486 T12 ; Total of 12 objects (otherwise the firmware must count)
M486 S3  ; Indicate that the 4th object is starting now
M486 S-1 ; Indicate a non-object, purge tower, or other global feature
M486 P10 ; Cancel object with index 10 (the 11th object)
M486 U2  ; Un-cancel object with index 2 (the 3rd object)
M486 C   ; Cancel the current object (use with care!)

M500: パラメータを不揮発性メモリに保存(Store parameters in non-volatile storage)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes Yes ??? Yes No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No No No No
M500

現在のパラメータをEEPROM、SDカード、その他の不揮発性メモリに保存する。

Redeemでは、コンフィグファイルから読み込まれるパラメータではない、G/M-codesによって設定されるものはローカルコンフィグに書き戻される。

例えば、M906 and M907によって設定されるステッピングモーター電流やマイクロステップ数はM500コマンドによって /etc/redeem/local.cfg が更新される。

M501: パラメータを不揮発性メモリから読み込む(Read parameters from EEPROM)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes ??? ??? Yes Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No ??? No No
パラメータ
Snnn オートセーブを有効にする (RepRapFirmwareのみ)
M501

EEPROM、SDカード、不揮発性メモリに保存されているパラメータを読み出して有効にする。これはテストで一時的にパラメータを書き換えた後に元に戻すのに有効である。

バージョン1.17より前のRepRapFirmwareでは"S1"の省略が可能で、パラメータが変更されると自動的にセーブされる。

バージョン1.17より後のRepRapFirmwareではパラメータはSDカード上の sys/config-override.g ファイルにセーブされる。

M502: デフォルト設定に戻す(Restore Default Settings)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes Yes ??? ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? Yes No No No ??? No No
Example
M502

このコマンドは変更可能なパラメータをリセットしファームウェアのコンフィグファイルに設定されている初期値に戻す。 このコマンドはEEPROMに保存されているすべてのパラメータを初期化するわけではない。そして有効にするためにはM500を続けて実行し再起動が必要である。

M503: 現在の設定を確認する(Report Current Settings)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes Yes ??? ??? ??? Yes Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No Yes No No No ??? No No
M503 ; 現在の設定を出力する
M503 S0 ; Settings as G-code only (Marlin 1.1)

このコマンドはファームウエアにメモリ上にある現在のプリント設定の出力を要求する。ここで出力される設定内容はEEPROMに保存されているものと異なる可能性がある点には注意が必要である。返される出力にはM92コマンドによって表示されるSteps-Per-Unitの値のようにGコードコマンドによって表示されるものもある。

RepRapFirmwareはコンフィグファイルの内容を出力するが、長すぎる場合は途中で切れてしまう可能性があることに注意が必要である。

M504: EEPROMのチェック(Validate EEPROM)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
1.1.9+ Not needed No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
M504 ; EEPROMをチェックする

このコマンドはEEPROMの内容(バージョン、サイズ、チェックサム)をチェックし結果を表示する。

M505: ファームウェアごとに異なる(Firmware dependent)

M505: EEPROMをクリアしプリンターをリセットする(Clear EEPROM and RESET Printer)
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

このコマンドはEEPROMの内容を消去しマザーボードをリセットする。

M505: コンフィグファイルフォルダーを設定する(Set configuration file folder)
Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes:2.03 No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
P"name" ; フォルダーの名前, デフォルトのルートは /sys/ で相対パスで指定する 。
M505 P"experimental" ; コンフィグファイルのパスを/sys/ から /sys/experimental/ に変更する。

このコマンドによって、通常 /sys/ フォルダから読み込まれるファイル (RepRapFirmwareのホーミングファイルやシステムマクロのような) は指定したフォルダから読み込まれるようになる。変更前にすでに読み込まれているファイルに関してはそのまま動作する。 このコマンドは複数の設定を簡単に管理するために使用されます。RepRapFirmwareでは /sys/config/g は以下の2行を使うことが可能です:

M505 P"config1"
M98 P"config.g"

1行目は設定ファイルフォルダを /sys/config1 に変更します。そして2行目は、フォルダ内にある config.g を実行します。別の設定を選ぶには1行目のフォルダを変更するだけとなります。

M509: 強制的な言語変更(Force language selection)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
??? ??? ??? ??? ??? Yes ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? ??? ??? ??? ??? ??? ??? ???

システム言語を英語にする。

このコマンドは複数言語を持つオリジナルPrusa i3 MK2.5/s and MK3/s でのみ有効。

M524: SDカードからのプリントを中止する(Abort SD Printing)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
2.0.0+ Use M25 then M0 No ??? ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
M524

SDカードからのプリントが進行中であれば、画面から"Stop print"を実行するのと同じようにプリントを中止する。

M530: プリントモードの有効化(Enable printing mode)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes ??? ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No1
Example
M530 S1 L270

このコマンドはシステムにプリント開始 (S1) や終了 (S0)を通知する。パラメータLはレイヤー数を設定する。パラメータL0はレイヤー数不明を意味する。このコマンドによってシステムはプリント状況を表示する特別なディスプレイモードに変更が可能になります。システムは以下の1行を伴うM115による進行状況を表示する必要がある。:

Cap:PROGRESS:1
注釈

1MK4duoでは、このコマンドはプリント回数の統計を開始する。またヒーターの30分タイマーを停止する。もしタイマーが30に達した場合すべてのヒーターを停止する。

M531: プリント中オブジェクトの名前設定(Set print name)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No No Yes ??? ??? No Yes ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No ??? No No
M531 Demo Model

現在プリント中のオブジェクトの名前を設定する。M530 S1 コマンドが正しい表示を行うために必要。

M532: プリント進捗状況の設定(Set print progress)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
M73 No Yes ??? ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
M532 X23.7 L56

プリント進捗状況 (X = 0..100)及び現在のプリントレイヤー (L)を設定する。このコマンドはすべてのプリントレイヤーが変わるタイミングで0.1%刻みで発行される必要がある。

M540: Macアドレスの設定(Set MAC address)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No ??? No No
パラメータ
Pnnn Macアドレス
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED
M540 PDE:AD:BE:EF:CA:FE

RepRapの MAC address を設定する。この作業は他のネットワークコマンドを使う前に行う必要がある。

Macアドレスは6つの2桁からなる16進数によって成り立っており、コロン(:)で区切られる。接頭辞0xは最近のファームウェアバージョンではつけてもつけなくてもよいオプション扱い。

同一ネットワーク上で稼働するすべてのデバイスは異なるMacアドレスを持つ必要がある。個人的な使用であれば最後の1桁を変更するだけで問題ない。

このコマンドはユニークなMacアドレスが付与されていない古い機器(例えばDuet 0.6 and Duet 0.8.5)のみ使う必要がある。

M540 Marlin: エンドストップに当たった時にSDカードからのプリントを停止する動きの有効化/無効化(Enable/Disable "Stop SD Print on Endstop Hit")

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
Yes No No No ??? No1 Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Snnn S1=有効, S0=無効
M540 S1
注釈

PrusaファームウェアではこのGコードはデフォルトで無効化されているため使用するにはソースコードを変更する必要がある。1

M550: プリンタ名の設定(Set Name)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Pnnn プリンタ名
M550 PGodzilla

RepRapの名前を(今回の例では)Gozzillaと設定する。プリンタ名は';'(';'はコメントスタートを意味する)を除く表示可能なキャラクタの文字列で構成される必要がある。

M551: パスワードの設定(Set Password)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Pnnn パスワード
M551 Pmy-very-secret-word

起動するのにパスワードが必要な機器でパスワードを設定する。コマンドの直後の'P'はパスワードに含まれないので注意すること。何も入力しない状態やインテンドしただけの状態のパスワードはセキュリティ対策にはなり得ないので注意。しかし、ネットワーク上のプリンタが権限なしで応答しなくなることを防ぐことができる。

パスワードは';'(';'はコメントスタートを意味する)を除く表示可能なキャラクタの文字列で構成される必要がある。

RepRapファームウェアにおける注意: もしパスワードがデフォルトのパスワード(要するにreprap)と異なる場合、ユーザーがHTTP又はTelnetでプリンタに接続するにはパスワードを要求される。FTPによる接続ではパスワードは常に無視される。

M552: IPアドレスの設定、ネットワークインターフェースの有効化/無効化(Set IP address, enable/disable network interface)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Pnnn IPアドレス, 0.0.0.0 はDHCPサーバからIPアドレスを取得する。
Snnn (オプション) -1 = ネットワークインターフェースを初期化する0 = ネットワークインターフェースを無効化する, 1 = ネットワークインターフェースをクライアントとして有効にする, 2 = ネットワークインターフェースをアクセスポイントとして有効化する(Wi-Fiを電気的に有効にするのみ)
Rnnn (オプション, RepRapファームウェア 1.17 及びそれ以前のみ) HTTP ポートの指定, デフォルト 80
M552 P192.168.1.14

プリンタのIPアドレスを(この例では)192.168.1.14に設定する。S パラメータを付けない場合ネットワークインターフェースの有効/無効のステータスは変化しない。

RepRapファームウェア 1.18 及びそれ以降ではHTTPポートアドレスは M586 コマンドで設定されるため R パラメータは現在サポートされていない。

パラメータなしで実行した場合、現在のネットワークステータス及びIPアドレスを返す。

M553: ネットマスクの設定(Set Netmask)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Pnnn ネットマスク
M553 P255.255.255.0

RepRapマシンのネットマスクを(この例では)255.255.255.0に設定する。新しいネットマスクを適用するにはプリンタの再起動が必要になることがある。

コマンドのみで 'P' オプションをつけない場合、現在のネットマスクの値を返す。

最新のRepRapファームウェアバージョンでは再起動なしでIPアドレス関係の変更を行うことができる。

M554: ゲートウェイの設定(Set Gateway)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Pnnn ゲートウェイ
M554 P192.168.1.1

RepRapマシンのゲートウェイIPアドレスを(この例では)192.168.1.1に設定する。新しいゲートウェイIPアドレスを適用するにはプリンタの再起動が必要になることがある。

コマンドのみで 'P' オプションをつけない場合、現在のゲートウェイIPアドレスを返す。

最新のRepRapファームウェアバージョンでは再起動なしでIPアドレス関係の変更を行うことができる。

M555: 互換性の設定(Set compatibility)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Pnnn エミューレーションタイプ
M555 P1

他のファームウェアと同様のに入出力を行うようにファームウェアのモードを設定する。

'P' オプション:

P value Firmware
0 ネイティブ (本来のファームウェアのモード)
1 RepRapファームウェア
2 Marlin
3 Teacup
4 Sprinter
5 Repetier
6 Marlin nanoDLP向け

M556: 軸補整(Axis compensation)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Snnn 計測された高さHeight of the measured distances
Xnnn X方向の偏差Deviation in X direction
Ynnn Y方向の偏差Deviation in Y direction
Znnn Z方向の偏差Deviation in Z direction
M556 S100 X0.7 Y-0.2 Z0.6
このようにしてM556コマンドのためにSパラメータを決定する。

機械の精度内で適切な角度にに調整された軸が提供されているのにも関わらず、ソフトウェア的に解決できる問題に対して誰が機械の調整に煩わされたがるだろう?

このコマンドはソフトウェアに対してテストパーツをプリント、計測して得られた機器の軸間角度を渡す。Sパラメータ(例では100)は各軸間の三角形の辺の長さ(単位mm)を表す。X、Y及びZの数値は三角形の短辺がどれだけ各軸のペアの正しい数値からずれているかを示す。XはX軸とY軸間、YはY軸とZ軸間、ZはX軸とZ軸間のずれである。プラスの数値は鈍角を示し、マイナスの数値は鋭角を示す。

M557: Zプローブの計測点及びグリッドの指定(Set Z probe point or define probing grid)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No Yes ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータは G32 で使用する計測点を設定する。 (Cartesian/CoreXY プリンタのみ。RepRapファームウェアでは現在サポートされていない)
Pnnn 計測点番号
Xnnn X座標
Ynnn Y座標
M557 P1 X30 Y40.5
パラメータは G29 で使用するグリッドを指定する。 (すべての単位はmm)
Xaaa:bbb プローブが計測する最小と最大のX座標
Yaaa:bbb プローブが計測する最小と最大のY座標
Rnnn 半径
Snn 又は Sxx:yy 計測点の間隔
Pnn or Pxx:yy 各方向の計測点の数 (RepRapファームウェア 2.02 以降) 間隔指定の代わりに使用する
M557 X0:200 Y0:220 S20
M557 R150 S15

計測点ではベッドの微妙な傾きを補正するための計測を行う。

G32 のベッド計測 P オプションは(0から始まる)計測点の通し番号で、XY の値はエクストルーダー0が移動する座標。 最低3つの計測点(P0、P1、P2)を指定する必要がある。このコマンドは計測するのではなく計測点の座標を記憶するだけである G32 を参照。このコマンドで計測点を指定する方法は現在RepRapファームウェアではサポートされていない。代わりに bed.g ファイルを使用する。

G29 では計測するグリッドを指定する。Cartesianプリンタでは最大、最小のX、Y座標と間隔を指定する。デルタプリンタでは計測半径を指定する。両方指定した場合は計測点は四角形と円の交点となる。計測点の数は各ファームウェアの仕様(だいたい100以下)に依存する。

M557: Zプローブの計測点及びグリッドの指定(Set Z probe point or define probing grid)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No Yes ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータは G32 で使用する計測点を設定する。 (Cartesian/CoreXY プリンタのみ。RepRapファームウェアでは現在サポートされていない)
Pnnn 計測点番号
Xnnn X座標
Ynnn Y座標
M557 P1 X30 Y40.5
パラメータは G29 で使用するグリッドを指定する。 (すべての単位はmm)
Xaaa:bbb プローブが計測する最小と最大のX座標
Yaaa:bbb プローブが計測する最小と最大のY座標
Rnnn 半径
Snn 又は Sxx:yy 計測点の間隔
Pnn or Pxx:yy 各方向の計測点の数 (RepRapファームウェア 2.02 以降) 間隔指定の代わりに使用する
M557 X0:200 Y0:220 S20
M557 R150 S15

計測点ではベッドの微妙な傾きを補正するための計測を行う。

G32 のベッド計測 P オプションは(0から始まる)計測点の通し番号で、XY の値はエクストルーダー0が移動する座標。 最低3つの計測点(P0、P1、P2)を指定する必要がある。このコマンドは計測するのではなく計測点の座標を記憶するだけである G32 を参照。このコマンドで計測点を指定する方法は現在RepRapファームウェアではサポートされていない。代わりに bed.g ファイルを使用する。

G29 では計測するグリッドを指定する。Cartesianプリンタでは最大、最小のX、Y座標と間隔を指定する。デルタプリンタでは計測半径を指定する。両方指定した場合は計測点は四角形と円の交点となる。計測点の数は各ファームウェアの仕様(だいたい100以下)に依存する。


M558: Zプローブタイプの指定(Set Z probe type)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Pnnn Zプローブのタイプ
Fnnn フィード (例 計測時のヘッド降下スピード 単位(mm/min)
Hnnn プローブ時のヘッドの降りる高さ (単位mm)
Innn Zプローブの読み取る数値を反転 (I1) 反転しない (I0) (RepRapファームウェア 1.16 以降)
Rnnn Zプローブが計測後に元の状態に復帰する時間 デフォルト値は0 (単位 秒) (RepRapファームウェア 1.17 以降)1
Tnnn 計測点間の移動スピード (単位 mm/min)
Annn 各計測点での最大計測回数 デフォルト値は1 (RepRapファームウェア 1.21 以降)
Snnn 複数回計測する時の許容値 デフォルト値は 0.03 (RepRapファームウェア 1.21 以降)
Bn B1 計測時にすべてのヒーターをオフにする。(RepRapファームウェア 1.21 以降)
過去に使われていたパラメータ
Xnnn この数値が0でない場合、X軸のホーミングにプローブを使用する。 (RepRapファームウェア 1.19 以前)
Ynnn この数値が0でない場合、Y軸のホーミングにプローブを使用する。 (RepRapファームウェア 1.19 以前)
Znnn この数値が0でない場合、Z軸のホーミングにプローブを使用する。 (RepRapファームウェア 1.19 以前)
M558 P1 F500 T5000 H3

Zプローブは近接赤外線センサーのようなスイッチである。このパラメータでは種類を指定する。:

P0 Zプローブなし
P1 unmodulated IR probe あるいは unmodulated IR probe と同じ振る舞いをするもの (プローブの信号はアナログでノズルの高さが下がると信号値は上がっていく)プローブのコントロール信号がある場合、P1オプションでは信号が強くなる。
P2 modulated IR probe, メインボードのファームウェアからコントロール信号によってプローブは制御される。
P3 他のZプローブを選択。P1に似ているがコントロール信号はP1と比較して弱い。
P4 スイッチ式プローブ (DuetではE0エンドストップピンに接続されなくてはならない。)
P5 (RepRapファームウェア 1.14) Zプローブコネクタに接続されたスイッチ又はデジタル信号を出力するデバイス
P6 P4と同じだが他のコネクタ(ピン)に接続されたもの。 (DuetシリーズではE1エンドストップコネクタ)
P7 P4と同じだが他のコネクタ(ピン)に接続されたもの。 (DuetシリーズではZエンドストップコネクタ)
P8 P5と同じだが信号は早すぎる反応に対してフィルタリングされない。
P9 P5と同じだがプローブは各計測点で伸縮する。このオプションはBLTouch用に用意。

関連コマンド: G29, G30, G31, G32, M401, M402.

M559: コンフィグファイルのアップロード(Upload configuration file)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
M559

プリンタがサポートする場合、設定ファイルをアップロードすると再起動して設定を変更する。この設定ファイルは通常特殊なGコードが記述されている。M559コマンドを実行後ファイルは送信される、またこのファイルの内容はM29で終わる必要がある。

M560: webページのアップロード(Upload web page file)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
M560
Webサポートが実装されている、あるいはWebブラウザでコントロールするタイプのプリンタのために、このコマンドはプリンタコントロールページをアップロードする。コマンド実行後ファイル(通常1つのhtmlファイル)が送信される。このファイルの最終行は
<!-- **EoF** -->
である必要がある。この最終行の文字列はbody内に入れることはできないが一番最後には記述することができる。この制限はあまり厳しくすべきではない。

M561: レベリング制御の譲渡(Set Identity Transform)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No Yes ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No Yes No No
M561

このコマンドはプローブ(あるいは類する何か)によるベッドレベリングをキャンセルしユーザーの手に渡す。

M562: 温度異常のリセット(Reset temperature fault)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No Yes No No
パラメータ
Pnnn ヒーター番号
M562 P2

温度異常を検知したヒーター(センサー)2をリセットする。プリンタが温度異常を検知して電源断、またはロックした場合、このコマンドでリセットする。温度異常の原因が解消されていない状態でこのコマンドを発行してもプリンタは再び電源断又はロックする。 P0 ベッド、P1 エクストルーダー0など

最新のRepRapファームウェアはすべてのヒーターをリセットするPパラメータなしのM562コマンドをサポートする。

M563: Toolの定義又は削除(Define or remove a tool)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Pnnn Tool番号
S"name" Tool名 (オプション)
Dnnn ドライバ
Hnnn ヒーター
Fnnn パーツクーリングファンとして定義するファン (RepRapファームウェア 1.16 以降)
Xnnn X軸 (RepRapファームウェア 1.16 以降)
Ynnn Y軸
Lnnn フィラメントマッピング用のドライバRepRapファームウェアのデフォルトでは特に指定しない限り最初かつ唯一のエクストルーダードライバを使用する。 (RepRapファームウェア 2.02 以降)
M563 P0 D0:2:3 H1:3                 ; エクストルーダードライバ0、2、3、ヒーター1、3を使用するToolを定義
M563 P1 D1 H2 X3                    ; エクストルーダードライバ1、ヒーター2、X軸=U軸を使用するToolを定義
M563 P2 D0:1 H1:2 X0:3 F0:2         ; エクストルーダードライバ0、1、ヒーター1、2、X軸=XとU軸、ファン0、2を使用するToolを定義
M563 P3 D0 H1 S"Chocolate extruder" ; エクストルーダードライバ0、ヒーター1を使う名前つきのToolを定義

Toolは通常(必須ではないけれど)エクストルーダーを指定する。'P'オプションはTool番号を指定する。Tool番号は0及び正の整数をつけることができる。

'D'オプションはToolが使用するドライバを指定する。最初の例ではToolは0、2、3を使用している。ドライバ0はプリンタの持つ最初のドライバを意味し対応する動きを制御する(通常はX、Y、Z)。Dオプションに何も記述されていない場合、Toolはドライバを使用しない。

'H'オプションはToolが使用するヒーターを指定する。最初の例ではヒーター1と3を使用している。ヒーター0は通常ベッドヒーターを意味するためエクストルーダーヒーターは通常1になる。Hオプションに何も記述されていない場合、Toolはヒーターを使用しない。 Toolは以下に示す様なG1 コマンドの複数の'E'オプションを使って駆動される。:

G1 X90.6 Y13.8 E2.24:2.24:15.89
G1 X70.6 E0:0:42.4

1行目は指定した点までストレートに移動しながら0と2ドライバを使って2.24mmのフィラメントを吐出、さらにドライバ3を使って15.98mmのフィラメントを吐出している。

2行目はX軸を20mm戻ってドライバ3を使って42.4mm吐出している。


スライサーが複数の'E'オプションを持つG1コマンドの作成をサポートしない場合、M567コマンドを使うことができる。

通常 M563コマンドは発行直後にG10コマンドによってToolのオフセットや温度を指定する。

異なるToolがいくつかの(あるいは全ての)ドライバやヒーターを共用することは可能である。例えば、同一のドライバ、ヒーターを共用するが異なる温度で動かす2つのToolを作成することも可能である。

Xマッピングオプションは複数のXキャリッジを持つ機器でToolを作成するときに使用することができる。Zより後のキャリッジはU、Vなどと定義される。(M584参照)そしてM563コマンドのXマッピングオプションでどのキャリッジが使用されるか定義される。

M563コマンドをすでに使用されているPオプションの値と一緒に使う場合、Toolは新しい値で再定義される。

RepRapファームウェアはM563にさらに書式を追加できる。

コマンド:

M563 S1

Sオプションは現在実行中の入力(コマンドがSDカードのファイルからから読まれているのであればファイル)の中にある全てのTool番号に1を足す。これは新たにM563コマンドが発行されるまで有効である。このオプションの目的はTool番号が1から始まるシステムとTool番号が0から始まるslic3rの様なプログラムとの間の互換性維持のためである。

最近のバージョンのRepRapファームウェアでは以下のような書式で発行されたM563コマンドによってToolの削除が可能になる。:

M563 P1 D-1 H-1

M564: 軸の動きの制限(Limit axes)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Hnnn H1 = ホームにない軸の移動を禁止する。H0 = ホームにない軸の移動を許可する。 (RepRapファームウェア 1.21 以降)
Snnn S1 = 軸の移動を設定範囲内に制限する。, S0 = 軸の移動を設定範囲外にも許可する。
M564 S0 H0

Sオプションが0の場合、設定範囲外に移動させるGコードを送信すると、プリンタはそのように動く。同様に、Hオプションが0の場合ホーミングしていない軸を移動させることができる。デフォルトではS1 H1が設定されている。デルタやSCARAの様なプリンタではホーミング前のHオプションによる動きは制限される。

M565: Zプローブオフセットの設定(Set Z probe offset)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No use G31 No Yes ??? No No ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
??? No No No No ??? No No
M565 X3 Y4.5 Z-2.37

プローブがどれだけノズルからオフセットしているかを設定する。XYZはそれぞれの軸方向にどれだけプローブの先端とノズルが離れているかの数値である。プローブの計測点がノズルより下にある場合Zの値はマイナスとなる。このコマンドは計測を行うのではなく位置を記憶するだけである。G32参照。

M566: ジャーク最大値設定(Set allowable instantaneous speed change)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
パラメータ
Xnnn X軸方向のジャーク最大値 (単位 mm/min)
Ynnn Y軸方向のジャーク最大値
Znnn Z軸方向のジャーク最大値
Ennn エクストルーダーのジャーク最大値
M566 X20 Y20 Z2 E10

各モーターの動く向きが変わる際のジャーク最大値を設定する。

RepRapシステムで使われるモデルファイルやGコードは一般的に円や弧、直線で構成される。もしモーターがジャークを許可されていないとすると、異なるラインの交わる場所でノズルが一度停止してから再度動き出すことになる。適切な量のジャークを許可することにより、異なる軌跡のプリントラインが交わる場所でもプリントスピードが維持される。この値は小さい値で十分である。

XYをとても小さく設定したとすると、カーブプリント時に速度が落ちる。大きな設定をするとノイズ増加、脱調やクオリティの低下に悩まされることになるだろう。

とても古いバージョンのRepRapファームウェア(1.09 以前)ではこれらは全ての軸の最小速度でもあった。

M567: Set tool mix ratios

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No
Parameters
Pnnn Tool number
Ennn Mix ratios
Example
M567 P2 E0.1:0.2:0.1:0.6

This example sets the mix ratio for tool 2 (the P value). When mixing is then turned on (see M568), only single E values need to be sent on a G1 command (any extra E values will be ignored, but are not illegal):

G1 X20 E1.3

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.

See also M568.

M568: Turn off/on tool mix ratios (obsolete)

Support Marlin RepRapFirmware Repetier Smoothie Klipper Prusa MK4duo MakerBot
No Yes No No ??? No Yes No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa
No No No No No No No No

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.

M569: Stepper driver control

Support