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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? No ??? ??? ??? ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???

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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???

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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???

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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???

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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? Yes1 ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No No No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Usage
M49 S1 ; Enable G26 verbose debug output

M70: Display message

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M117 M117 No No ??? M117 M117 ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No M117 No M117 Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M300 M300 No M300 ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No: See M300 Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? Yes1 ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No No No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No

M76: Pause the print job timer

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

M77: Stop the print job timer

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

M78: Show statistical information about the print jobs

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

M80: ATX Power On

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes1 ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes1 ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes2 ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? Yes ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? Yes ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use M92 ??? ??? ??? ??? No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes No No No No No No ???

M98: Call Macro/Subprogram

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No Yes No
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No Yes No
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes: 1.17c and later ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes: 1.17c and later ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes1 ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes No Yes No Yes Yes No Yes
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 B@: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
  • B@ - 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes Yes Yes Yes Yes No Yes ???

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

M108: Cancel Heating

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes No Yes Yes Yes not needed Yes 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? No2 ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.9+ No ??? Yes ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes No Yes No Yes Yes No Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes2 ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes No Yes No Yes Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No Yes No Yes Yes No Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No Yes No No No No No: See M70
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes1 ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.4+ No ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???
Example
M121

Recover the last state pushed onto the stack.

M120: Enable endstop detection

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

M121: Disable endstop detection

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

M122: Firmware dependent

M122: Diagnose (RepRapFirmware)
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???

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

M122: Debug L6470 drivers (Marlin)
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???

Immediately stops all motors.

M124: Set Endstop Pullup
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No Yes No No No No Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No Yes No No No No Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M301 M301 ??? M301 ??? No M301 ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No M301 Yes M301 No
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M301 M301 ??? M301 ??? No M301 ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No M301 Yes M301 No
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M301 M301 ??? M301 ??? No M301 ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No M301 Yes M301 Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M301 M301 ??? M301 ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No M301 Yes M301 Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No: See M500 ??? No ??? No No: See M504 ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No Yes No Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No M301 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes No Yes 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes See below ??? No1 ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.0+ No ??? Yes ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.0+ M567 ??? No ??? 0.92+ No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.0+ No ??? No ??? 0.92 No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.0+ M567 ??? No ??? No: No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
2.0.0+ 1.17+ ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes 1.19+ ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No Yes No No No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? Yes ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No

Set temperature monitor to Sx. Repetier Firmware only.

M204: Set default acceleration

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes 1.18+ ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes M566 ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No

Output EEPROM settings. Repetier Firmware only.

M206: Offset axes

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? No Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No Yes No No No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? No Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use G1 S3 ... ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No M566 ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No ??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Use M207 ??? Yes ??? No Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? Yes ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use M564 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Partial* Use G31 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Use G10 ??? Yes1 ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes1 ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No Yes No No No No No ???

M221: Turn on AUX V1.0.5

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

M222: Set speed of fast XY moves

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

M223: Set speed of fast Z moves

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

M224: Enable extruder during fast moves

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

M225: Disable on extruder during fast moves

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

M226: G-code Initiated Pause

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes see M577 ??? Yes ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???
Example
M228

See also M227.

M229: Enable Automatic Reverse and Prime

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???

M240: Trigger camera

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No1 ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use M106 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use M106 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???
Example
M246

M250: Set LCD contrast

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? Yes ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.0+ 1.21+ ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.0+ 1.21+ ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes 1.16+ ??? No1 ??? Use M340 No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.7+ 1.18+ ??? No ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes1 ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No Yes No No No Yes
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes1 ??? Yes ??? 0.92+ No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes 1.15+ ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? ??? M301 ??? M301
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? ??? Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.15+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 3.0+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???
Example
M351

M355: Turn case lights on/off

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.0+ No ??? No ??? 0.92.2+ No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M503 No ??? M503 ??? 0.92.2+ No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Partial No ??? No ??? No Yes ??? Partial
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No ??? No ??? No

M360: Move to Theta 0 degree position

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No Yes ??? Experimental
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No Yes ??? Experimental
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No Yes ??? Experimental
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No Yes ??? Experimental
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No Yes ??? Experimental
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Use M579 ??? No ??? No Yes ??? Experimental
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use M557 ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.17+ ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.17+ ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M420Z 1.17+ ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? ??? No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No ??? No No No
Example
M380

Activates solenoid on active extruder.

M381: Disable all solenoids

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

M400: Wait for current moves to finish

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes 1.17+ ??? No ??? ??? No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes 1.17+ ??? No ??? ??? No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Use M591 ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Use M591 ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No ??? No No No
Example
M406

Turn off Filament Sensor extrusion control.

M407: Display filament diameter

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.0-RC2+ Use M112 ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
2.0+ Use M591 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
2.0+ Use M911 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Use G29 and M376 ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? ??? ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
2.0.x+ No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use M106 ??? No ??? Yes No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes:2.03 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes:2.03 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes ??? ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No Yes No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes ??? ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? Yes No No No ??? No No ???
Example
M502

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

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

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? ??? ??? ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
1.1.9+ Not needed ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
M504 ; EEPROMをチェックする

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

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

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

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

M505: コンフィグファイルフォルダーを設定する(Set configuration file folder)
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes:2.03 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???

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

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

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

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

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

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

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

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

Cap:PROGRESS:1
注釈

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

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

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

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

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

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M73 No ??? No ??? Yes ??? ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? No1 ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
パラメータ
Snnn S1=有効, S0=無効
M540 S1
注釈

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

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

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

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

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

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
M559

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

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

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

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

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

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

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

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No use G31 ??? No ??? No Yes ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No 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 Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Pnn Motor driver number
Sn Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards (default 1)
Rn Driver enable polarity: 0 = active low, 1 = active high (default 0)
Tnn Minimum driver step pulse width and interval in microseconds (RepRapFirmware 1.14 and later)
Taa:bb:cc:dd Minimum driver step pulse width, step pulse interval, direction-to-step setup time and step-to-direction hold time, in microseconds (RepRapFirmware 1.21 and later)
Dnn Stepper driver mode (RepRapFirmware 2.0 and later): 0=constant off time, 1=random off time, 2=spread cycle, 3=stealthChop
Fnn (firmware 2.02 and later) Off-time in the chopper control register, 1 to 15
Bnn (firmware 2.02 and later) Blanking time (tbl) in the chopper control register, 0 to 3. See the TMC driver datasheet.
Yaa:bb or Yaa:bb:cc (firmware 2.02 and later) Hysteresis start, end and decrement values in the chopper control register. See the TMC driver datasheet for the meaning.
Cnnn Custom chopper control register value (RepRapFirmware 2.0 and later). Do not change this value without having a good understanding of the stepper driver driver chip!
Hnn (firmware 2.02 and later) t_high parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into mm/sec. See also the V parameter.
Vnnn (firmware 2.02 and later) tpwmthrs parameter for those stepper driver chips that support it (e.g. TMC2208, 2224). This is the interval in clock cycles between 1/256 microsteps below which the drivers will switch from stealthChop to to spreadCycle mode. Only applies when the driver is configured in stealthChop mode. Typical value are from 100 (high speed) to 4000 (low speed). Send M569 P# (where # is the driver number) with no additional parameters to see how this translates into axis speed in mm/sec.
Example
M569 P0 S0               ; reverse the direction of the motor attached to driver 0
M569 P5 R1 T2.5:2.5:5:0  ; driver 5 requires an active high enable, 2.5us minimum step pulse, 2.5us minimum step interval, 5us DIR setup time and no hold time
Notes

All parameters except P are optional. For any parameter that is not provided, the corresponding value will not be changed.

The T parameters are intended for use with external stepper drivers. Currently, RepRapFirmware only remembers the highest T parameters seen in any M569 command, and applies those values to all drivers for which any nonzero T parameters were specified.

The modes (D parameter) supported by various stepper driver chips are:

TMC2130: modes 0,1,2,3
TMC2660: modes 0,1,2
TMC2208/2224: modes 2,3 (mode 3 is stealthChop 2)

Some versions of RepRapFirmware prior to 1.14 also provided X, Y, Z and E parameters to allow the mapping from axes and extruders to stepper driver numbers to be changed. From 1.14 onward, this functionality is provided by M584 instead.

M570: Configure heater fault detection

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters for RepRapFirmware 1.14 and earlier
Snnn Heater timeout (in seconds)
Example
M570 S120

After a heater has been switched on, wait 120 seconds for it to get close to the set temperature. If it takes longer than this, raise a heater fault.

Parameters for RepRapFirmware 1.15e and later
Hnnn Heater number
Pnnn Time in seconds for which a temperature anomaly must persist on this heater before raising a heater fault (default 5 seconds)
Tnnn Permitted temperature excursion from the setpoint for this heater (default 10C)
Snnn Time in seconds after a heater fault is raised after which the print will be abandoned, default 10 minutes (RepRapFirmware 1.20 and later)
Example
M570 H1 P4 T15

Warning! Heating fault detection is provided to reduce the risk of starting a fire if a dangerous fault occurs, for example if the heater cartridge or thermistor falls out of the heater block. You should not increase the detection time or permitted temperature excursion without good reason, because doing so will reduce the protection.

M571: Set output on extrude

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
Snnn Output value
Fnnn Output PWM frequency (RepRapFirmware 1.17 and later)
Pnnn Logical pin number (RepRapFirmware 1.17 and later), defaults to the FAN0 output until M571 with a P parameter has been seen
Example
M571 P3 F200
M571 S0.5

This turns the controlled pin output on whenever extrusion is being done, and turns it off when the extrusion is finished. The output could control a fan or a stirrer or anything else that needs to work just when extrusion is happening. It also can be used to control a laser beam. The S parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on.

In RepRapFirmware 1.17 and later you can use the P parameter to change the pin used and you can also set the PWM frequency. Pin numbers are the same as in the M42 and M280 commands. The pin you specify must not be in use for anything else, so if it is normally used as a heater you must disable the heater first using M307, or if it is used for a fan you must disable the fan using M106 with the I-1 parameter.

M572: Set or report extruder pressure advance

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Dnnn Extruder number
Snnn Pressure advance amount (in seconds)
Example
M572 D0 S0.1

This sets the pressure advance coefficient (S parameter) for the specified extruder (D parameter). Supported by RepRapFirmware-dc42, -ch and -dn.

Pressure advance causes the extruder drive position to be advanced or retarded during printing moves by an additional amount proportional to the rate of extrusion. At the end of a move when the extrusion rate is decreasing, this may result in the extruder drive moving backwards (i.e. retracting). Therefore, if you enable this feature, you may need to reduce the amount of retraction you use in your slicing program to avoid over-retraction.

With Bowden extruders, an S value between 0.1 and 0.2 usually gives the best print quality.

Older versions of RepRapFirmware used the P parameter to specify the drive number, instead of using D to specify the extruder number.

M573: ヒーターPWM取得(Report heater PWM)

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

このコマンドはPオプションで指定したヒーターのPMWの平均値(通常5秒間隔)を取得する。供給電圧とヒーターの抵抗値が分かっているのであればヒーターへの電流量を算出することができる。Scale: 0 to 1。

M574: エンドストップ設定(Set endstop configuration)

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
パラメータ
Xnnn X軸エンドストップの位置を変更Switch position for X axis
Ynnn Y軸エンドストップの位置を変更Switch position for Y axis
Znnn Z軸エンドストップの位置を変更Switch position for Z axis
Snnn エンドストップタイプの指定: 0 = 負論理エンドストップ, 1 = 正論理エンドストップ, 2 = Zプローブ, 3 = 負荷検出
M574 X1 Y2 Z0 S1  ; X軸のエンドストップ位置はX軸の始点, Y軸のエンドストップ位置はY軸の終点, Z軸エンドストップなし, すべて正論理に設定

このコマンドはプリンタの各軸が持つエンドストップの位置、状態を定義する0=なし、1=始点、2=終点。Sオプションはエンドストップの動きを定義するS0=負論理、S1=正論理、S2=Zプローブ、S3=モーターの負荷検出(デフォルトはS1)。

普通に接続されたノーマリークローズ(NC)タイプのエンドスイッチは正論理(S1)である。他の軸で異なるタイプのエンドストップセンサーを使っている場合はM574コマンドを2回に分けて入力することができる。

デルタプリンターではXYZパラメータは各タワーを参照し、エンドストップは一番上に配置される。

S2、S3オプションはRepRapファームウェア 1.20 以降でサポート。

RepRapファームウェア 1.16 以前ではEオプション付きのM574コマンドはE0エンドストップ入力コネクタに接続されたZプローブのS1(正論理)、S0(負論理)の指定に使用されていたが、1.17 以降でM558を使用するように変更されている。

M575: シリアル接続パラメータ設定(Set serial comms parameters)

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
2.0+ Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No ???
パラメータ
Pnnn COMポート番号
Bnnn ボーレート
Snnn チェックサムの有効/無効
Example
M575 P1 B57600 S1

このコマンドはPオプションによってシリアル通信に使用するCOMポート番号を設定する。P0はメインのシリアル通信インターフェース(USBポート、あるいはUSBを経由したシリアル通信)を指す。そして、P1は追加のシリアルポートを指定する(例 PanelDueに接続するポート)。Bオプションはボーレートを指定する(純粋にUSBポートで通信している場合は無視される)。Sオプションはチェックサムの有効/無効の指定。一番下の桁のbitがセットされていれば使用されたCOMポートから受け取ったというチェックサムとして機能する。

M577: エンドストップのトリガーを待機(Wait until endstop is triggered)

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
パラメータ
Snnn 求めるエンドストップのトリガー
Xnnn X軸方向のエンドストップを指定
Ynnn Y軸方向のエンドストップを指定
Znnn Z軸方向のエンドストップを指定
Ennn エクストルーダードライバの動かす軸のエンドストップを指定
M577 E0 S1

エンドストップのスイッチが押されるまで待機する。例では最初のエクストルーダーのエンドストップの反応を待つ。

Sオプションで以下のトリガータイプを指定できる。:

0: エンドストップに当たっていない 1: 始点のエンドストップにヒット 2: 終点のエンドストップにヒット 3: エンドストップに近づいている (Zプローブのみ)

M578: Fire inkjet bits

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Pnnn Inkjet head number
Snnn Bit pattern
Example
M578 P3 S5

This fires inkjet head 3 (the P field) using the bit pattern specified by the S field. The example shown would fire bits 101. If the P parameter is ommitted inkjet 0 is assumed.

This is a version of the M700 command used by the Inkshield, but unfortunately M700 is already taken so cannot be used for that in the standard.

M579: Scale Cartesian axes

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Xnnn Scale factor for X axis
Ynnn Scale factor for Y axis
Znnn Scale factor for Z axis
Example
M579 X1.0127 Y0.998

On a Cartesian RepRap you can get prints exactly the right size by tweaking the axis steps/mm using the M92 G Code above. But this does not work so easily for Delta and other RepRaps for which there is cross-talk between the axes. This command allows you to adjust the X, Y, and Z axis scales directly. So, if you print a part for which the Y length should be 100mm and measure it and find that it is 100.3mm long then you set Y0.997 (= 100/100.3).

M580: Select Roland

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Rnnn Whether Roland mode should be activated
Pnnn Initial text to send to the Roland controller
Example
M580 R1 PVS4;!VZ2;!MC1;

This is not really anything to do with RepRap, but it is convenient. The little Roland mills are very widely available in hackerspaces and maker groups, but annoyingly they don't speak G Codes. As all RepRap firmware includes a G-Code interpreter, it is often easy to add functions to convert G Codes to Roland RML language. M580 selects a Roland device for output if the R field is 1, and returns to native mode if the R field is 0. The optional P string is sent to the Roland if R is 1. It is permissible to call this repeatedly with R set to 1 and different strings in the P field to communicate directly with a Roland.

M581: Configure external trigger

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Tnn Logical trigger number to associate the endstop input(s) with, from zero up to a firmware-specific maximum (e.g. 9 for RepRapFirmware)
X, Y, Z, E Selects endstop input(s) to monitor
P Reserved, may be used in future to allow general I/O pins to cause triggers
S Whether trigger occurs on a rising edge of that input (S1, default), falling edge (S0), or ignores that input (S-1). By default, all triggers ignore all inputs.
C Condition: whether to trigger at any time (C0, default) or only when printing a file from SD card (C1)
Example
M581 E1:2 S1 T2 C1   ; invoke trigger 2 when a rising edge is detected on the E1 or E2 endstop input and a file is being printed from SD card

When M581 is executed, if the T parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger. Using S-1 with no X, Y, Z or E parameters sets the trigger back to ignoring all inputs.

In RepRapFirmware, trigger number 0 causes a full (emergency) stop as if M112 had been received. Trigger number 1 causes the print to be paused as if M25 had been received. Any trigger number # greater then 1 causes the macro file sys/trigger#.g to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the M400 command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.

M582: Check external trigger

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
T Trigger number to poll
Example
M582 T2 ; check levels of inputs that give rise to trigger #2

Triggers set up by the M581 command are normally activated only when the specified inputs change state. This command provides a way of causing the trigger to be executed if the input is at a certain level. For each of the inputs associated with the trigger, the trigger condition will be checked as if the input had just changed from the opposite state to the current state.

For example, if you use M581 to support an out-of-filament sensor, then M582 allows you to check for out-of-filament just before starting a print.

M584: Set drive mapping

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.14+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Xnnn Driver number(s) for X motor(s)
Ynnn Driver number(s) for Y motor(s)
Znnn Driver number(s) for Z motor(s)
U,V,W, A, B, Cnnn Driver number(s) for additional axes U, V, W, A, B and C (UVW RepRapFirmware 1.16 and later; ABC RepRapFirmware 1.19 and later)
Ennn Driver number(s) for E motor(s)
Pnnn Number of visible axes, defaults to the total number of axes configured.
Example
M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls Y, 2 and 3 control Z motors, 4 and 5 control E motors

Assigning a drive using M584 does not remove its old assignment. Therefore, if you assign a drive that defaults to being an extruder drive, you should also assign the extruder drives explicitly as in the above example. Failure to do so may result in unexpected behaviour.

You can use M584 to create additional axes - for example, to represent additional carriages on a machine with multiple independent X carriages. Additional axes must be created in the order UVWABC. You can hide some of the last axes you create using the P parameter. Hidden axes have no homing buttons or jog controls in the user interface.

On the Duet WiFi and Duet Ethernet, if you configure multiple drivers for an axis, either all of them must be TMC2660 drivers on the Duet or a Duet expansion board, or none of them must be. This is to facilitate dynamic microstepping and other features of the TMC2660.

M585: Probe Tool

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

In machines with a tool probe this probes the currently selected tool against it and corrects the offsets set by the G10 command (q.v.).

Parameter must be only one of
Xnnn
Y-nnn
Znnn

Where the absolute value of nnn is the radius of the tool plus the radius of the probe in that direction. So M585 X1.5 will set the X offset of a 1mm diameter tool against a 2mm diameter probe, etc. If the value of nnn is positive the tool is moved in the positive direction towards the probe until it touches. If it is negative, the tool moves the other way.

So the process should be:

Set the values as closely as known in the G10 command.
Move to a position slightly offset from the probe then execute M585s in X, Y and Z in the tool selection macro to set them precisely.

After this, the G10 command on its own can be used to report the values.

M586: Configure network protocols

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.18+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Pnn Protocol: 0 = HTTP or HTTPS, 1 = FTP or SFTP, 2 = Telnet or SSH (which of the two choices depends on the T parameter)
Snn 0 = disable this protocol, 1 = enable this protocol
Rnn TCP port number to use for the specified protocol. Ignored unless S = 1. If this parameter is not provided then the default port for that protocol and TLS setting is used.
Tnn 0 = don't use TLS, 1 = use TLS. Ignored unless S = 1. If this parameter is not provided, then TLS will be used if the firmware supports it and a security certificate has been configured. If T1 is given but the firmware does not support TLS or no certificate is available, then the protocol will not be enabled and an error message will be returned.

M586 with no S parameter reports the current support for the available protocols.

RepRapFirmware 1.18 and later enable only HTTP (or HTTPS if supported) protocol by default. If you wish to enable FTP and/or Telnet, enable them using this command once or twice in config.g.

M587: Store WiFi host network in list, or list stored networks

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Sccc Network SSID
Pccc Network password
Inn.nn.nn.nn (optional) IP address to use when connected to this network. If zero or not specified then an IP address will be acquired via DHCP.
Jnn.nn.nn.nn (optional) Gateway IP address to use when connected to this network.
Knn.nn.nn.nn (optional) Netmask to use when connected to this network

If a password or SSID includes space or semicolon characters then it must be enclosed in double quotation marks. For security, do not use this command in the config.g file, or if you do then remove it after running it once so that the network password is not visible in the file.

M587 with no parameters lists all stored SSIDs, but not the stored passwords.

M588: Forget WiFi host network

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Sccc SSID to remove from the networks list

The specified SSID will be removed from the networks list and the associated password cleared out of EEPROM. If the SSID is given as * then all stored networks will be forgotten.

M589: Configure access point parameters

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No No
Parameters
Sccc The SSID that the WiFi interface should use when it is commanded to run as an access point
Pccc The WiFi password
Inn.nn.nn.nn The IP address to use

Note: WPA2 security will be used by default.

M590: Report current tool type and index

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

Report the current tool type, which may be "Extruder," "Picker," "Laser," "Foam Cutter," "Milling," or any others implemented by the machine. Also report the tool index, such as "0x01" for the second extruder.

Example
> M590
> echo: Extruder 0x00

M591: Configure filament monitoring

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

This configures filament sensing for the specified extruder. The sensor may be a simple filament presence detector, or a device that measures movement of filament, or both. The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.

Parameters
Cnn Which input the filament sensor is connected to. On Duet electronics: 0=X endstop input, 1=Y endstop input, 2=Z endstop input, 3=E0 endstop input etc.
Dnn Extruder drive number (0, 1, 2...),
Pnn Type of sensor: 0=none, 1=simple sensor (low signal when filament present), 2=simple sensor (high signal when filament present), 3=Duet3D rotating magnet sensor, 4=Duet3D rotating magnet sensor with microswitch, :Snn S0 = disable filament monitoring, S1 = enable filament monitoring. Calibration data may be collected while printing even when filament monitoring is disabled.

5=Duet3D laser filament monitor, 6=Duet3D laser filament monitor with microswitch, 7=pulse-generating sensor

Additional parameters for Duet3D laser filament monitor
Raa:bb Allow the filament movement reported by the sensor to be between aa% and bb% of the commanded values; if it is outside these values and filament monitoring is enabled, the print will be paused
Enn minimum extrusion length before a commanded/measured comparison is done, default 3mm
Additional parameters for Duet3D rotating magnet filament monitor
Lnn Filament movement per complete rotation of the sense wheel, in mm
R, E As for Duet3D laser filament monitor
Additional parameters for a pulse generating filament monitor
Lnn Filament movement per pulse in mm
R, E As for Duet3D laser filament monitor
Examples
M591 D0 C3 P5 S1 R70:130 L24.8 E6.0  ; Duet3D laser sensor for extruder drive 0 is connected to E0 endstop input, 24.8mm/rev, 70% to 130% tolerance, 6mm detection length
M591 D1  ; display filament sensor parameters for extruder drive 1

Note: RepRapFirmware 1.19 and 1.20 also supported filament monitors via M591, but some of the parameters were different.

M592: Configure nonlinear extrusion

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20.1+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Dnn Extruder drive number (0, 1, 2...)
Annn A coefficient in the extrusion formula, default zero
Bnnn B coefficient in the extrusion formula, default zero
Lnnn Upper limit of the nonlinear extrusion compensation, default 0.2
T nnn Reserved for future use, for the temperature at which these values are valid
Example
M592 D0 A0.01 B0.0005 ; set parameters for extruder drive 0
M592 D0 ; report parameters for drive 0

Most extruder drives use toothed shafts to grip the filament and drive it through the hot end. As the extrusion speed increases, so does the back pressure from the hot end, and the increased back pressure causes the amount of filament extruded per step taken by the extruder stepper motor to reduce. This may be because at high back pressures, each tooth compresses and skates over the surface of the filament for longer before it manages to bite. See forum post http://forums.reprap.org/read.php?262,802277 and the graph at http://forums.reprap.org/file.php?262,file=100851,filename=graph.JPG for an example.

Nonlinear extrusion compensates for this effect. The amount of extrusion requested is multiplied by (1 + MIN(L, A*v + B*v^2)) where v is the requested extrusion speed (calculated from the actual speed at which the move will take place) in mm/sec.

Nonlinear extrusion is not applied to extruder-only movements such as retractions and filament loading.

M593: Configure Dynamic Acceleration Adjustment

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 2.02+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Fnnn Frequency of ringing to cancel in Hz. Zero or negative values disable the feature.
Example
M593 F40.5

This is an experimental feature of RepRapFirmware. By default, Dynamic Acceleration Adjustment (DAA) is disabled. If it is enabled, then acceleration and deceleration rates will be adjusted separately per-move to cancel out ringing at the specified frequency. Any acceleration values set using M204 will be saved but ignored until DAA is disabled, but acceleration limits set by M201 will still be honoured.

DAA is most useful to avoid exciting low-frequency ringing, for which S-curve acceleration is ineffective and may make the ringing worse. High-frequency ringing is better countered by using S-curve acceleration.

To measure the ringing frequency, take a print that exhibits ringing on the perimeters (for example a cube), preferably printed single-wall or external-perimeters-first. Divide the speed at which the outer perimeter was printed (in mm/sec) by the distance between adjacent ringing peaks (in mm), measured away from the corner so that the head has reached the full printing speed.

Cartesian and CoreXY printers will typically have different frequencies of ringing for the X and Y axes. In this case it is is usually best to aim to cancel the lower ringing frequency, because the higher frequency will be less strongly excited. If the frequencies are not much different, in a moving-bed cartesian printer you could reduce the higher ringing frequency by adding mass to that axis. Note that X axis ringing causes artefacts predominantly on the Y face of the test cube, and vice versa.

M594: Enter/Leave Height Following mode

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 3.0+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Pn P1 = enter height following mode, P0 = leave height following mode

Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M951.

If a movement command (e.g. G1) explicitly mentions the Z axis while height following mode is active, existing moves in the pipeline will be allowed to complete and the machine allowed to come to a standstill. Then height following mode will be terminated and the new move executed.

M600: Set line cross section

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? ??? ??? ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No Yes ??? No No ???
Example
M600 P0.061

Sets the cross section for a line to extrude in velocity extrusion mode. When the extruder is enabled and movement is executed the amount of extruded filament will be calculated to match the specified line cross section.

M600: フィラメント交換のための一時停止(Filament change pause)

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes 2.02RC3+ ??? Yes1 ??? ??? Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???

フィラメントを交換するためにプリントを一時停止する。

パラメータ
X[pos] 一時停止させるヘッドのX座標
Y[pos] 一時停止させるヘッドのY座標
Z[relative lift] 一時停止させるヘッドのZ座標(M600コマンド実行時のヘッド位置から相対位置指定)
E[initial retract] マテリアルの垂れ防止のためのリトラクション量指定
L[later retract distance for removal] フィラメントを取り出すための戻し量指定
AUTO 自動 (MMUの接続されたPrusaファームウェアマシンのみ)1
M600

SmoothieWare:

M600コマンドの後"after_suspend_gcode"が実行される。

例:

after_suspend_gcode G91_G0E-5_G0Z10_G90_G0X-50Y-50 # 一時停止後に実行されるgcode。 引き戻しを行いヘッドを退避する。

RepRapファームウェアではM600コマンドは、存在しているならばfilament-change.gを実行するが、存在しない場合はpause.gを実行し、M600コマンドのパラメータは無視される。

Prusaファームウェアでは、このコマンドはフィラメント切れセンサーが反応したときも使われる。ブロブ防止のために25mmヘッドを上方に移動させる。デフォルト値は X=211, Y=0, Z=2mm, E=-2, L=-801

M601: プリントの一時停止(Pause print)

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

Prusa i3 MK2/s,MK2.5/s,MK3/sでプリントを一時停止させる。

M602: プリントの再開(Resume print)

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

Prusa i3 MK2/s,MK2.5/s,MK3/sでプリントを一時停止状態から復帰させる。

M603: プリントの停止(Stop print)

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

Prusa i3 MK2/s,MK2.5/s,MK3/sでプリントを停止する。

M605: デュアルXキャリッジの動作モード設定(Set dual x-carriage movement mode)

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

デュアルXキャリッジの動作モードを設定する。

パラメータ
S[mode] モード指定
X[duplication x-offset] モード2で使うためのXオフセット
R[duplication temp offset] モード2で使うための温度指定
M605 S1 ; モードをauto-parkに指定

M605 S0: フルコントロールモード。スライサーがXキャリッジの動きを全て制御する。 M605 S1: Auto-parkモード。アクティブでないヘッドをスライサーの指示ではなく自動で退避位置に移動させる。 M605 S2 [Xnnn] [Rmmm]: 複製モード。2番目のエクストルーダーは1番目のエクストルーダー設定に対して、X座標のオフセットと温度の違いを付加した設定を使用する。

例えば、"M605 S2 X100 R2" このような設定の場合、2番目のエクストルーダーは1番目のエクストルーダーから100mmX方向で離れており、2度温度が高い状態になる。

RepRapファームウェアはM605コマンドは実装していない。M563コマンドを使用する。

M650: Set peel move parameters

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

This command is sent by nanoDLP to set the parameters for the peel move used after curing a layer. RepRapFirmware 2.02 ignores it. if using RepRapFirmware 2.03 or later you can create a empty file M650.g to cause it to be ignored.

M651: execute peel move

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

This command is sent by nanoDLP to execute a peel move after curing a layer. RepRapFirmware 2.02 executes macro /sys/peel-move.g in response to this command. For RepRapFirmware 2.03 and later, create a macro file M651.g containing the commands required to execute the peel move.

M665: Set delta configuration

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? No ??? No Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Lnnn Diagonal rod length
Rnnn Delta radius
Snnn Segments per second1
Bnnn Safe probing radius2,3
Hnnn Delta height defined as nozzle height above the bed when homed after allowing for endstop corrections 2
Xnnn X tower position correction2,4
Ynnn Y tower position correction2,4
Znnn Z tower position correction2,4
Examples
M665 L250 R160 S200 ; (Marlin)
M665 L250 R160 B80 H240 X0 Y0 Z0 ; (RepRapFirmware and Marlin 1.1.0)

Set the delta calibration variables. (See the discussion page for notes on this implementation.)

Notes

1Only supported on Marlin.

2Only supported in RepRapFirmware and Marlin 1.1.0.

3 In Marlin 1.1.0 sets the radius on which the probe points are taken for the delta auto calibration routine G33 as well as for the manual LCD calibration menu.

4X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer. In Marlin 1.1.0 X,Y and Z tower angular offsets will be rotated so the Z tower angular offset is zero.

M666: Set delta endstop adjustment

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? No ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Xnnn X axis endstop adjustment
Ynnn Y axis endstop adjustment
Znnn Z axis endstop adjustment
Annn X bed tilt in percent1
Bnnn Y bed tilt in percent1
Example
M666 X-0.1 Y+0.2 Z0

Sets delta endstops adjustments.

In RepRapFirmware and Repetier, positive endstop adjustments move the head closer to the bed when it is near the corresponding tower. In Marlin and Smoothieware, negative endstop corrections move the head closer to the bed when it is near the corresponding tower.

In Marlin, only negative endstop corrections are allowed. From version 1.1.0 onward positive endstops are allowed to be entered but the endstops will be normalized to zero or negative and the residue will be subtracted from the delta height defined in M665.

In Repetier the endstop corrections are expressed in motor steps. In other firmwares they are expressed in mm.

1RepRapFirmware 1.16 and later.

M667: Select CoreXY mode

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Snnn CoreXY mode
Xnnn X axis scale factor (RepRapFirmware 2.02 and earlier)
Ynnn Y axis scale factor (RepRapFirmware 2.02 and earlier)
Znnn Z axis scale factor (RepRapFirmware 2.02 and earlier)
Example
M667 S1

M667 S0 selects Cartesian mode (unless the printer is configured as a delta using the M665 command). Forward motion of the X motor moves the head in the +X direction. Similarly for the Y motor and Y axis, and the Z motor and Z axis. This is the default state of the firmware on power up.

M667 S1 selects CoreXY mode. Forward movement of the X motor moves the head in the +X and +Y directions. Forward movement of the Y motor moves the head in the -X and +Y directions.

M667 S2 selects CoreXZ mode. Forward movement of the X motor moves the head in the +X and +Z directions. Forward movement of the Z motor moves the head in the -X and +Z directions.

RepRapFirmware 2.03 and earlier support additional parameters X, Y and Z may be given to specify factors to scale the motor movements by for the corresponding axes. For example, to specify a CoreXZ machine in which the Z axis moves 1/3 of the distance of the X axis for the same motor movement, use M667 S2 Z3. The default scaling factor after power up is 1.0 for all axes. In RepRapFirmware 2.03 and later, this functionality is moved to the movement matrix that you can define or alter using the M669 command.

To change the motor directions, see the M569 command.

M668: Set Z-offset compensations polynomial

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No dc42-cmm ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No

Polynomial compensation is an experimental method to compensate for geometric distortion of a delta machine Z-plane. After the bed is compensated with the set of G30 points, there remains error. This method fits a 6th degree polynomial with independent origins for each order to the residual error data (using a simulated annealing technique on the host). The polynomial is communicated and controlled through M668. Because the polynomial takes many floating point operations to compute each point, the firmware builds a grid of values, and used bi-linear interpolation to adjust the actual Z-axis offset error estimate.

For the polynomial used, 40 parameters are specified. The I parameter allows the coefficients to be loaded a few at a time, which limits the size of the G-code string. The index starts with 1, not with 0.

M668 Ix S[list of values] sets the polynomial parameters starting at index x, if index present and != 0.

M668 R recomputes the grid based on the current parameters.

M668 P[0|1] turns off or on the polynomial compensation.

Typical usage
M668 I1 S4.882E-17:0.0
M668 I3 ...
...
M668 R P1

Which sets the list, computes the interpolation grid, and then enables compensation.

M669: Set kinematics type and kinematics parameters

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Knnn Kinematics type: 0 = Cartesian, 1 = CoreXY, 2 = CoreXZ, 3 = linear delta, 4 = serial SCARA, 5 = CoreXYU, 6 = Hangprinter, 7 = polar, 8 = CoreXYUV, 9 = linear delta + Z axis, 10 = rotary delta, 11 = MarkForged, 12 = reserved for Collinear Tripteron

Selects the specified kinematics, then uses the other parameters to configure it. If the K parameter is missing then the other parameters are used to update the configuration data for the current kinematics. If no parameters are given then the current kinematics and configuration parameters are reported

Parameters for generalised Cartesian kinematics (including CoreXY, CoreXZ, MarkForged, CoreXYU etc.)
Xnnn, Ynnn, Znnn, Unnn etc. (optional) Movement matrix coefficients. For example. X1:-1:0 tells the firmware that to move the X axis one unit, the first motor must be moved 1 unit in the forwards direction, the second motor 1 unit in the reverse direction, and the third motor not at all. Using these coefficients, you can specify the kinematics equations for any printer with up to 10 axes for which the movement of each axis is a linear combination of the movements of the individual motors. If these parameters are omitted, the defaults for the specified kinematics (K parameter) will be used.
Parameters for serial SCARA kinematics
Pnnn Proximal arm length (mm)
Dnnn Distal arm length (mm)
Annn:nnn Proximal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to the X axis
Bnnn:nnn Proximal-to-distal arm joint movement minimum and maximum angles, in degrees anticlockwise seen from above relative to both arms in line
Cnnn:nnn:nnn Crosstalk factors. The first component is the proximal motor steps to equivalent distal steps factor, the second is the proximal motor steps to equivalent Z motor steps factor, and the third component is the distal motor steps to equivalent Z motor steps factor.
Snnn Segments per second if smooth XY motion is approximated by means of segmentation
Tnnn Minimum segment length (mm) if smooth XY motion is approximated by means of segmentation
Xnnn X offset of bed origin from proximal joint
Ynnn Y offset of bed origin from proximal joint
Examples
M669 K4 P300 D250 A-90:90 B-135:135 C0:0:0 S200 X300 Y0

The minimum and maximum arm angles are also the arm angles assumed by the firmware when the homing switches are triggered. The P, D, A and B parameters are mandatory. The C and F parameters default to zero, and the segmentation parameters default to firmware-dependent values.

Parameters for Polar kinematics
Raaa:bbb Minimum and maximum radius in mm. If only one value it given it will be used as the maximum radius, and the minimum radius will be assumed to be zero.
Hnnn Radius in mm at which the homing switch is triggered during a homing move. If this parameter is not present, the homing switch is assumed to trigger at the minimum radius.
Fnnn Maximum turntable speed in degrees per second
Annn Maximum turntable acceleration in degrees per second per second
Snnn, Tnnn As for serial SCARA kinematics

M670: Set IO port bit mapping

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Pnn:nn:nn... List of logical port numbers that bits 0, 1, 2... control
Tnnn port switching time advance in milliseconds

RepRapFirmware 1.19 and later provides an optional P parameter on the G1 command to allow I/O ports to be set to specified states for the duration of the move. The argument to the P parameter is a bitmap giving the required state of each port. The M669 command specifies the mapping between the bits of that argument and logical port numbers. Optionally, the T parameter can be used to advance the I/O port switching a short time before the corresponding move begins.

M671: Define positions of Z leadscrews or bed leveling screws

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
M422 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Xnn:nn:nn... List of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed leveling screws
Ynn:nn:nn... List of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed leveling screws
Snn Maximum correction to apply to each leadscrew in mm (optional, default 1.0)
Pnnn Pitch of the bed leveling screws (not used when bed leveling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed leveling screws.
Example
M671 X-15.0:100.0:215.0 Y220.0:-20.0:220.0  ; Z leadscrews are at (-15,220), (100,-20) and (215,220)

Informs the firmware of the positions of the leadscrews used to raise/lower the bed or gantry. The numbers of X and Y coordinates must both be equal to the number of drivers used for the Z axis (see the M584 command). This allows the firmware to perform bed leveling by adjusting the leadscrew motors individually after bed probing.

For machines without multiple independently-driven Z leadscrews, this command can be used to define the positions of the bed leveling screws instead. Then bed probing can be used to calculate and display the adjustment required to each screw to level the bed. The thread pitch (P parameter) is used to translate the height adjustment needed to the number of turns of the leveling screws.

M672: Program Z probe

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.19+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Snn:nn:nn... Sequence of 8-bit unsigned values to send to the currently-selected Z probe
Example
M671 S50:205

This command is for sending configuration data to programmable Z probes such as the Duet3D delta effector. The specified command bytes are sent to the probe. The Duet3D probe stores the configuration data in non-volatile memory, so there is no need to send this command every time the probe is used.

M673: Align plane on rotary axis

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 2.02+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
U,V,W,A,B,C Rotary axis letter on which the plane is mounted
Pnnn Factor to multiply the correction angle (degrees) with (defaults to 1)
Example
M673 A

This code is intended to align a plane that is mounted on a rotary axis. To make use of this code it is required to take two probe points via G30 P first. Supported in RepRapFirmware 2.02 and later.

M674: Set Z to center point

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

This code is intended to determine the Z center point of a stash that is mounted on a rotary axis. This code is yet to be implemented.

M675: Find center of cavity

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 2.02+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
X,Y,Z Axis to probe on
Fnnnn Probing feedrate
Rnnn Distance to move away from the lower endstop before the next probing move starts
Example
M675 X R2 F1200

This code is intended to find the center of a cavity that can be measured using the configured axis endstop. If using a Z probe for this purpose, make sure the endstop type for the corresponding axis is updated before this code is run. Once this code starts, RepRapFirmware will move to the lower end looking for an endstop to be triggered. Once it is triggered, the lower position is saved and the axis maximum is probed. As soon as both triggers have been hit, the center point is calculated and the machine moves to the calculated point.

M700: Level plate

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No M671,G32 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No ??? No
Example
M700

Script to adjust the plate level.

M701: Load filament

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

Initiate a filament load. This command can be used without any additional parameters.

Parameters
Snn Filament to load (RepRapFirmware)
Tnn Tool to load (Marlin)
Lnn Length to use for load (Marlin)
Znn Z raise to perform (Marlin)
With no parameters
  • RepRapFirmware will report the name of the loaded filament (if any).
  • Marlin Firmware initiates a Filament Load.
Examples
M701
M701 S"PLA" ; Only in RepRapFirmware
M701 T0     ; Only in Marlin.

RepRapFirmware 1.19 and later implement a filament management mechanism to load and unload different materials. This code may be used to load a material for the active tool, however be aware that this code will work only for tools that have exactly one extruder assigned. When called RepRapFirmware will...

  1. Run the macro file "load.g" in the subdirectory of the given material (e.g. /filaments/PLA/load.g)
  2. Change the filament name of the associated tool, so it can be reported back to Duet Web Control

M702: Unload filament

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

Initiate a filament unload. This command can be used without any additional parameters. In contrast to M701 this code is intended to unload the previously loaded filament from the selected tool.

Parameters
Tnn Tool to load (Marlin)
Unn Length to use for unload (Marlin)
Znn Z raise to perform (Marlin)

In response to M702 RepRapFirmware will do the following:

  1. Run the macro file "unload.g" in the subdirectory of the given material (e.g. /filaments/PLA/unload.g)
  2. Change the filament name of the current tool, so it can be reported back to Duet Web Control
Examples
M702         ; Unload filament as previously configured
M702 U420 Z2 ; Unload 420mm (Marlin) with a Z raise of 2mm

M703: Configure Filament

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No ??? No
  1. In RepRapFirmware this code is used to apply the configuration of a previously loaded filament (see M701). All it does is run /filaments/<loaded filament>/config.g which may contain codes to set parameters like extrusion factor, retraction distances and temperatures. If no filament is assigned to the current tool, this code will not generate a warning.

If the filaments feature is used, it is recommended to put this code into tpost*.g to ensure the right filament parameters are set. Supported in RepRapFirmware 2.02 and newer.

M710: Erase the EEPROM and reset the board

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

This command only exists in a defunct bq fork of Marlin Firmware.

Example
M710

M750: Enable 3D scanner extension

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.18+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Example
M750

This code may be used as an OEM extension to enable scanner functionality in the firmware. After a regular start of RepRapFirmware, the 3D scan extension is disabled by default, but if additional scanner components are attached, this code may be used to enable certain OEM functions.

M751: Register 3D scanner extension over USB

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.18+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Example
M751

When a 3D scanner board is attached to the USB port, this code is used to turn on communication between the 3D printing and the scanner board. If the USB connection is removed while the 3D scanner configuration is active, the firmware will disable it again and restore the default communication parameters.

M752: Start 3D scan

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.18+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Snnn: Length/degrees of the scan
Rnnn: Resolution (new in RRF 2.0) [optional, defaults to 100]
Nnnn: Scanner mode (new in RRF 2.0) [optional, 0=Linear (default), 1=Rotary]
Pnnn: Filename for the scan
Example
M752 S300 Pmyscan

Instruct the attached 3D scanner to initiate a new 3D scan and to upload it to the board's SD card (i.e. in the "scans" directory). Before the SCAN command is sent to the scanner, the macro file "scan_pre.g" is executed and when the scan has finished, the macro file "scan_post.g" is run. Be aware that both files must exist to avoid error messages.

M753: Cancel current 3D scanner action

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.18+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Example
M753

Instruct the attached 3D scanner to cancel the current operation. Cancelling uploads is not supported.

M754: Calibrate 3D scanner

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.18+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Nnnn Calibration mode (0=linear [default], 1=rotary)
Example
M754

Calibrates the attached 3D scanner. Before the calibration is performed by the external scanner, "calibrate_pre.g" is run and when it is complete, "calibrate_post.g" is executed.

M755: Set alignment mode for 3D scanner

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.18+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Pnnn Whether to turn on (> 0) or off (<= 0) the alignment feature
Examples
M755 P1
M755 P0

Sends the ALIGN ON/OFF command the attached 3D scanner. Some devices turn on a laser when this command is received. If the 'P' parameter is missing, equal to, or less than 0, the alignment feature is turned off. Depending on whether the alignment is turned on or off, either align_on.g or align_off.g is executed before the ALIGN command is sent to the scanner.

M756: Shutdown 3D scanner

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.18+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Example
M756

Sends the SHUTDOWN command the attached 3D scanner.

M800: Fire start print procedure

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

1 only in bq-Marlin Firmware

Example
M800

M801: Fire end print procedure

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

1 only in bq-Marlin Firmware

Example
M801

M851: Set Z-Probe Offset

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes 2.02RC5 and later, or use G31 ??? Yes ??? ??? ??? ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? No ???

Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with G28. This value may also be used by G29 to apply correction to the Z position.

This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch. (This is a common setup on delta machines.)

This setting is saved in the EEPROM by M500 and restored by M501. The default (as reset by M502) is set by the Z_PROBE_OFFSET_FROM_EXTRUDER setting in Configuration.h.

Note that in Marlin 1.1.0 and later M851 sets the value literally as given, while Marlin 1.0.2 negates the absolute value.

The examples below will set the Z-probe Z offset to -4mm (below the nozzle):

M851 in Marlin 1.0.2
M851 Z4 ; Set the Z probe offset to -4
M851 in Marlin 1.1.0
M851 Z-4 ; Set the Z probe offset to -4
M851 in Marlin 2.0.0
M851 X-22 Y3 Z-4 ; Set the probe XYZ offsets
M851 in MK4duo 4.3.25
M851 X2 Y-5 Z-4 ; Set the probe offset to X=2, Y=-5 and Z=-4
M851 in RepRapFirmware 2.02 and later

M851 Znn is implemented for backwards compatibility with other firmwares. It sets the Z probe trigger in the same way as G31 Z-nn (note the sign reversal). It also flags the Z-probe G31 parameters as to be saved in config-override.g if the M500 command is used.

M860 Wait for Probe Temperature
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? Yes ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Snnnn Target temperature
Notes

In Prusa Firmware this command will wait for the PINDA thermistor to reach a target temperature.

M861 Set Probe Thermal Compensation
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use G31 ??? Yes ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
? Print current EEPROM offset values
! Set factory default values
Z Set all values to 0 (effectively disabling PINDA temperature compensation)
S Microsteps
I Table index
Example
M861 ?

Results

PINDA cal status: 1
index, temp, ustep, um
n/a, 35, 0, 0.00
0, 40, 0, 0.00
1, 45, 0, 0.00
2, 50, 0, 0.00
3, 55, 0, 0.00
4, 60, 0, 0.00
Notes

In Prusa Firmware this command will set / read the PINDA temperature compensation offsets.

M862: Print checking

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

Checks the parameters of the printer and gcode and performs compatibility check

M862.1: Check nozzle diameter
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
Pnnnn nnnn = Nozzle diameter 0.25 /0.40 /0.60
Q Current nozzle diameter

When run with P<> argument, the check is performed against the input value. When run with Q argument, the current value is shown.

Example messages
warn Printer nozzle diameter differs from the G-code. Continue?
strict Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.
M862.2: Check model code
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
Pnnnn nnnn = Prusa model
Q Current model

When run with P<> argument, the check is performed against the input value. When run with Q argument, the current value is shown.

Accepted printer type identifiers and their numeric counterparts:

     - MK1         (100)
     - MK2         (200)       
     - MK2MM       (201)     
     - MK2S        (202)      
     - MK2SMM      (203)    
     - MK2.5       (250)     
     - MK2.5MMU2   (20250) 
     - MK2.5S      (252)    
     - MK2.5SMMU2S (20252)
     - MK3         (300)
     - MK3MMU2     (20300)
     - MK3S        (302)
     - MK3SMMU2S   (20302)
Example messages
warn G-code sliced for a different printer type. Continue?
strict G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.
M862.3: Model name
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
P"nnnn" nnnn = Prusa model name
Q Current model name

When run with P<> argument, the check is performed against the input value. When run with Q argument, the current value is shown.

It accepts text identifiers of printer types too. The syntax of M862.3 is (note the quotes around the type):

M862.3 P "MK3S"
Example messages
warn G-code sliced for a different printer type. Continue?
strict G-code sliced for a different printer type. Please re-slice the model again. Print cancelled.
M862.4: Firmware version
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
Pnnnn nnnn = Prusa firmware version
Q Current firmware version

When run with P<> argument, the check is performed against the input value. When run with Q argument, the current value is shown.

Example messages
warn G-code sliced for a newer firmware. Continue?
strict G-code sliced for a newer firmware. Please update the firmware. Print cancelled.
M862.5: Gcode level
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
Pnnnn nnnn = Gcode level
Q Current Gcode level

When run with P<> argument, the check is performed against the input value. When run with Q argument, the current value is shown.

Example messages
warn G-code sliced for a different level. Continue?
strict G-code sliced for a different level. Please re-slice the model again. Print cancelled.

M876: Dialog handling

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Pnnn signal support for dialog creation on the host = 1, disable = 0
Snnn select dialog option nnn (0 based)
Example
M876 P1
M876 S1

M876 S<n> allows selecting an option of a prompt on a connected host created by the firmware through the corresponding action commands, see G-code#Action_commands. The S parameter is the 0-based index of the chosen option - 0 for the first option provided by the firmware, 1 for the second and so on.

Example: A prompt with three options defined via the firmware and completed by the host by selecting the second option ("Home X/Y and pause print")

 <<< //action:prompt_begin Filament runout detected. Please choose how to proceed:
 <<< //action:prompt_choice Swap filament
 <<< //action:prompt_choice Home X/Y and pause print
 <<< //action:prompt_choice Abort print
 <<< //action:prompt_show
 >>> M876 S1

To indicate the availability of this function, M115 will add an extra line:

Cap:PROMPT_SUPPORT:1

so hosts know about the presence of the function.

M890 Run User Gcode

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No No ??? No ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Snnn select 1 - 5 User Gcode defined in configuration.
Example
M890 S2  ; Start User Gcode 2

M900 Set Linear Advance Scaling Factors

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

Sets the advance extrusion factors for Linear Advance. If any of the R, W, H, or D parameters are set to zero the ratio will be computed dynamically during printing.

Parameters
K[factor] Advance K factor
R[ratio] Set ratio directly (overrides WH/D)
W[width] H[height] D[diam] Set ratio from WH/D
Examples
M900 K0.7 W0.4 H0.1 D1.75 ; Set K and WH/D ratio
M900 R0.025   ; Set the WH/D ratio directly
M900 R0 ; Set to "auto ratio"

Requires enabling the LIN_ADVANCE feature in Marlin 1.1.

The K factor in the M900 command supported by early versions of Marlin is related to the S factor in the long-established M572 command supported by RepRapFirmware by the following formula:

K = S * extruder_steps_per_mm

More recent versions of Marlin appear to have removed the steps/mm dependency, so now K = S.

M905: Set local date and time

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.16+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No No No No No No No
Parameters
Pnnn Current date in the format YYYY-MM-DD
Snnn Current time in the format HH:MM:SS
Example
M905 P2016-10-26 S00:23:12

Updates the machine's local date and time or reports them if no parameters are specified. The time should be specified in 24-hours format as in "13:45" instead of 1:45PM.

M906: Set motor currents

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No M907? ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No Yes No No ???
Parameters
Xnnn X drive motor current
Ynnn Y drive motor current
Znnn Z drive motor current
Ennn E drive(s) motor current(s)
Innn Motor idle current in percent (0..100)
Example
M906 X300 Y500 Z200 E350:350

Sets the currents to send to the stepper motors for each axis. The values are the peak current per phase in milliamps.

The I parameter is the percentage of normal that the motor currents should be reduced to when the printer becomes idle but the motors have not been switched off. The default value is 30%. On delta printers in particular you may need to increase it to e.g. 60% to prevent the carriages from dropping when the current is reduced to the idle value.

M907: Set digital trimpot motor

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

Set digital trimpot motor current using axis codes (X, Y, Z, E, B, S). In Repetier, it sets the current in Percent. In Redeem, it sets the current in Amps (whereas M906 uses milliamps).

M908: Control digital trimpot directly

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

M908 P<pin> S<current>

Notes

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

M909: Set microstepping

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Use M350 Use M350 ??? ??? ??? Use M350 No ??? Use M350
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No Yes No ??? ???
Example
M909 X3 Y5 Z2 E3

Set the microstepping value for each of the steppers. In Redeem this is implemented as powers of 2 so…

M909 X2 ; set microstepping on X-axis to 2^2 = 4
M909 Y3 ; set microstepping on Y-axis to 2^3 = 8 etc.

M910: Set decay mode

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Use M569 ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No Yes No No ???
Example
M910 X3 Y5 Z2 E3

Set the decay mode for each stepper controller The decay mode controls how the current is reduced and recycled by the H-bridge in the stepper motor controller. It varies how the implementations are done in silicone between controllers. Typically you have an on phase where the current flows in the target current, then an off phase where the current is reversed and then a slow decay phase where the current is recycled.

M910: TMC2130 init

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M911: Configure auto save on loss of power ("power panic")

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???
Parameters
Saaa Auto save threshold in volts. The print will be stopped automatically and resume parameters saved if the voltage falls below this value. Set to around 1V to 2V lower than the voltage that appears at the Duet VIN terminals at full load. A negative or zero value disables auto save.
Raaa Resume threshold in volts. Must be greater than the auto save voltage. Set to a high value to disable auto resume.
P"command string" G-Code commands to run when the print is stopped.
Example
M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"

When the supply voltage falls below the auto save threshold while a print from SD card is in progress, all heaters will be turned off, printing will be stopped immediately (probably in the middle of a move), the position saved, and the specified command string executed. You should typically do the following in the command string:

  • If possible, use M913 to reduce the motor current in order to conserve power. For example, on most printers except deltas you can probably set the X and Y motor currents to zero.
  • Retract a little filament and raise the head a little. Ideally the retraction should happen first, but depending on the power reserve when low voltage is detected, it may be best to do both simultaneously.

M911 with no parameters displays the current enable/disable state, and the threshold voltages if enabled.

Note: RepRapFirmware 1.19 used different parameters. You are recommended to upgrade to version 1.20 or later if you wish to use this "power panic" functionality.

M911: Set TMC2130 holding currents

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? Use M917 ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M912: Set electronics temperature monitor adjustment

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???
Parameters
Pnnn Temperature monitor channel, default 0
Snnn Value to be added to the temperature reading in degC
Example
M912 P0 S10.5

Many microcontrollers used to control 3D printers have built-in temperature monitors, but they normally need to be calibrated for temperature reading offset. The S parameter specifies the value that should be added to the raw temperature reading to provide a more accurate result.

M912: Set TMC2130 running currents

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M913: Set motor percentage of normal current

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???
Parameters
X, Y, Z, E Percentage of normal current to use for the specified axis or extruder motor(s)
Example
M913 X50 Y50 Z50 ; set X Y Z motors to 50% of their normal current
M913 E30:30 ; set extruders 0 and 1 to 30% of their normal current

This allows motor currents to be set to a specified percentage of their normal values as set by M906. It can be used (for example) to reduce motor current during course homing, to make homing quieter or to reduce the risk of damage to endstops, to reduce motor current when using sensorless endstops (motor stall detection), and to reduce current while loading filament to guard against the possibility of feeding too much filament. Use M913 again with the appropriate parameters set to 100 to restore the normal currents.

M913: Print TMC2130 currents

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M914: Set/Get Expansion Voltage Level Translator

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Alligator build only ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No ???
Parameters
S Expansion voltage signal level, must be 3 or 5
Example
M914 S5 ; set expansion signal level to 5V
M913 ; report expansion signal voltage level

M914: Set TMC2130 normal mode

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M915: Configure motor stall detection

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
Pnnn:nnn:... Drive number(s) to configure
X,Y,Z,U,V,W,A,B,C Axes to configure (alternative to using the P parameter)
Snnn Stall detection threshold (-64 to +63, values below -10 not recommended)
Fn Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step)
Hnnn (optional) Minimum motor full steps per second for stall detection to be considered reliable, default 200
Tnnn (optional) Coolstep control register, 16-bit unsigned integer
Rn Action to take on detecting a stall from any of these drivers: 0 = no action (default), 1 = just log it, 2 = pause print, 3 = pause print, execute macro file /sys/rehome.g, and resume print
Examples
M915 P0:2:3 S10 F1 R0
M915 X Y S5 R2

This sets the stall detection parameters and optionally the low-load current reduction parameters for TMC2660, TMC2130 or similar driver chips. Use either the P parameter to specify which driver number(s) you want to configure, or the axis names of the axes that those motors drive (the parameters will then be applied to all the drivers associated with any of those axes).

If any of the S, F, T and R parameters are absent, the previous values for those parameters associated with the specified drivers will continue to be used. If all the parameters are absent, the existing settings for the specified drives will be reported.

See the Trinamic TMC2660 and TMC2130 datasheets for more information about the operation and limitations of motor stall detection.

M915: Set TMC2130 silent mode

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? Use M569 to select StealthChop mode ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M916: Resume print after power failure

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
none
Example
M916

If the last print was not completed and resume information has been saved (either because the print was paused or because of a power failure), then the heater temperatures, tool selection, head position, mix ratio, mesh bed compensation height map etc. are restored from the saved values and printing is resumed.

RepRapFirmware also requires macro file /sys/resurrect-prologue.g to be present on the SD card before you can use M915. This file is executed after the heater temperatures have been set, but before waiting for them to reach the assigned temperatures. You should put commands in this file to home the printer as best as you can without disturbing the print on the bed. To wait for the heaters to reach operating temperature first, use command M116 at the start of the file.

M916: Set TMC2130 Stallguard sensitivity threshold

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? Use M915 ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M917: Set motor standstill current reduction

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
X,Y,Z,E Percentage of normal current to use when the motor is standing still or moving slowly, default 100
Example
M917 X70 Y70 Z80 E70:70

Some motor drivers (e.g. TMC2660) allow higher motor currents to be used while the motor is moving than when it is at standstill. This command sets the percentage of the current set by M906 that is to be used when the motor is stationary but not idle, or moving very slowly.

Standstill current reduction is not the same as idle current reduction. The standstill current must be high enough to produce accurate motion at low speeds; whereas the idle current (set using the I parameter in the M906 command) needs only to be high enough to hold the motor position sufficiently so that when the current is restored to normal, the position is the same as it was before the current was reduced to idle.

M917: Set TMC2130 PWM amplitude offset (pwm_ampl)

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M918: Configure direct-connect display

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

This command is used to tell RepRapFirmware about a directly-connected dumb LCD or similar display.

Parameters
P Directly-connected display type: 0 = none (default), 1 = 128x64 pixel mono graphics display using ST7920 controller
E The number of pulses generated by the rotary encoder per detent. Typical values are 2 and 4. Negative values (e.g. -2 and -4) reverse the encoder direction.
Example
M918 P1 E2

M918: Set TMC2130 PWM amplitude gradient (pwm_grad)

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Not active in default, only if TMC2130_SERVICE_CODES_M910_M918 is defined in source code.

M928: Start SD logging

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes No ??? ??? ??? No No ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Example
M928 filename.g

Stop SD logging with M29.

M929: Start/stop event logging to SD card

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 1.20+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
P"filename" The name of the file to log to. Only used if the S1 parameter is used. A default filename will be used if this parameter is missing.
Sn S1 = start logging, S0 = stop logging
Example
M929 P"eventlog.txt" S1  ; start logging to file eventlog.txt
M929 S0  ; stop logging

When event logging is enabled, important events such as power up, start/finish printing, most error messages and (if possible) power down will be logged to the SD card. Each log entry is a single line of text, starting with the date and time if available, or the elapsed time since power up if not. If the log file already exists, new log entries will be appended to the existing file.

M950: Create heater, fan or GPIO/servo device

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 3.0+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
Hnn Heater number
Fnn Fan number
Pnn or Snn GPIO or Servo number (the only difference is the default PWM frequency)
C"name" Pin name(s) and optional inversion status. Pin name "nil" frees up the pin. A leading '!' character inverts the output. A leading '^' character enables the pullup resistor. The '^' and '!' characters may be placed in either order.
Qnn PWM frequency in Hz (optional)
Tnn Temperature sensor number, required only when creating a heater.
Examples
M950 H1 C"out1" Q100 T1 ; create heater 1 using temperature sensor 1
M950 H2 C"nil" ; disable heater 2 and free up the associated pin
M950 H2 C"1.out0" T2 ; create heater 2 using pin out0 on expansion board 1 and temperature sensor 2
M950 F3 C"heater2" Q100 ; Fan 3 is connected to heater 2 pin, PWM at 100Hz
M950 P0 C"exp.heater3" ; create GPIO port 0 attached to heater 3 pin on expansion connector
M950 F2 C"!fan2+^pb6" ; Fan 2 uses the Fan2 output, but we are using a PWM fan so the output needs to be inverted, also we are using PB6 as a tacho input with pullup resistor enabled

M950 is used to create heaters, fans and GPIO ports and to assign pins to them. Each M950 command assigns a pin or pins to a single device. So every M950 command must have exactly one of the H, F, P or S parameters.

If a M950 command has C and/or Q parameters, then the pin allocation and/or frequency of the existing device will be configured accordingly. Otherwise, the current configuration will be reported.

When using M950 to create a heater, you must first use M308 to define a temperature sensor to control that heater, and specify its number in the T parameter of the M950 command.

M951: Set height following mode parameters

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 3.0+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
Snn or Hnn Sensor number
Pnn.n Proportional factor, in mm per sensor unit
Inn.n Integral factor, in mm per sensor unit per second
Dnn.n Derivative factor, in mm per rate of change of sensor units (change in sensor unit per second)
Fnn.n (optional) Sample and correction frequency (Hz), default 5Hz
Znn.n:nn.n Minimum and maximum permitted Z values

Height following mode allows the Z position of the tool to be controlled by a PID controller using feedback from a sensor. See also M594.

If commanding the motors to increase Z causes the sensor value to increase, then all of P, I and D must be positive. If commanding the motors to increase Z causes the sensor value to decrease, then all of P, I and D must be negative.

M952: Set CAN-FD bus data rate

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 3.0+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
Sn.n Requested bit rate in Mbits/second. Ignored if it is lower than the bit rate for the negotiation phase.
T0.n Fraction of the bit time between the bit start and the sample point (optional)
J0.n Maximum jump time as a fraction of the bit time (optional)
C0.n Transmitter delay compensation time in nanoseconds (optional)
Example
M952 S4.0 T0.6 J0.2

This command allows the bandwidth of the CAN bus to be optimised, by increasing the data rate during transmission of CAN-FD data packets by means of the BRS (bit rate switch) feature. The maximum speed supported by CAN-FD is 8Mbits/sec but the practical limit depends on the cable length, cable quality, number of devices on the bus and CAN interface hardware used. The rate specified will be rounded down to the nearest achievable rate.

M953: Change CAN-FD expansion board address

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No 3.0+ ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No No ???
Parameters
Bn Existing CAN address of expansion board to be changed, 1 to 125.
Sn New CAN address of that expansion board, 1 to 125.
Example
M953 B120 S11  ; change the CAN address of expansion board 101 to 11

Some CAN-connected expansion boards are too small to carry address selection switches. Such boards default to a standard address, which can be changed using this command.

M997: Perform in-application firmware update

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? No
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No No No No No
Parameters
Snnn Firmware module number(s), default 0
Bnnn Expansion board address, default 0 (i.e. main controller board)
Example
M997 S0:1 ; update firmware modules 0 and 1 on the main controller board
M997 B3 ; update firmware module 0 on the expansion board with address 3

This command triggers a firmware update if the necessary files are present on the SD card. In RepRapFirmware on the Duet series, module numbers are as follows:

0 - main firmware. The firmware filename depends on the controller electronics, e.g.sys/RepRapFirmware.bin (Duet 06/085), sys/Duet2CombinedFirmware (Duet WiFi/Ethernet), sys/DuetMaestroFirmware.bin (Duet Maestro). File sys/iap.bin (Duet), sys/iap4e.bin (Duet WiFi/Ethernet) or sys/iap4s.bin (Duet Maestro) must also be present.

1 - web server firmware, filename sys/DuetWiFiServer.bin

2 - (Duet WiFi running RepRapFirmware 1.18 and earlier only) web server file system, filename sys/DuetWebControl.bin

3 - put the WiFi module into bootloader mode so that firmware can be uploaded directly via its serial port

M998: Request resend of line

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
No Yes ??? No ??? No No ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? No No No No ??? No ??? ???
Parameters
Pnnn Line number
Example
M998 P34

Request a resend of line 34. In some implementations the input-handling code overwrites the incoming G Code with this when it detects, for example, a checksum error. Then it leaves it up to the G-code interpreter to request the resend.

M999: Restart after being stopped by error

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

Restarts the firmware using a software reset.

Notes

1The dc42 fork of RepRapFirmware not only resets the board but also puts the board into firmware upload mode if parameter PERASE is present.

Other commands

G: List all G-codes

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

Print a list of all implemented G-codes in the firmware with description to the host.
(Note: this has been implemented in Redeem, and so is only a proposal.)

M: List all M-codes

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

Print a list of all implemented M-codes in the firmware with description to the host.
(Note: this has been implemented in Redeem, and so is only a proposition)

T: Select Tool

Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
Yes Yes ??? Yes ??? Yes Yes ??? Yes
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
No No No Yes No Yes Yes Yes No
Parameters
This command can be used without any additional parameters.
Pnnn: Bitmap of all the macros to be run (only RRF 1.17b or later)
Tool number
Example
T1

Select tool (or in older implementations extruder) number 1 to build with.

The sequence followed is:

  1. Set the current tool to its standby temperatures specified by G10 (see above),
  2. Set the new tool to its operating temperatures specified by G10 and wait for all temperatures to stabilise,
  3. Apply any X, Y, Z offset for the new tool specified by G10,
  4. Use the new tool.

Selecting a non-existent tool (100, say) just does Step 1 above1. That is to say it leaves all tools in their standby state. You can, of course, use the G10 command beforehand to set that standby temperature to anything you like.

Note that you may wish to move to a parking position before executing a T command in order to allow the new extruder to reach temperature while not in contact with the print. It is acceptable for the firmware to apply a small offset [by convention (-1mm x tool-number) in Y] to the current position when the above sequence is entered to allow temperature changes to take effect just away from the parking position. Any such offset must, of course, be undone when the procedure finishes.

If the Z value changes in the offsets and the tool moves up, then the Z move is made before the X and Y moves. If Z moves down, X and Y are done first.

Some firmware (Such as Prusa i3 Printers with MMU) also support the Tx (recommended) and T?(depricated)2 commands to prompt the user to select a tool (or a filament in the case of the MultiMaterial Unit) on the printer's menu. Then the Tc command actually loads the selected filament.

Some implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros3. There are normally three specified (any of which can contain no commands if desired) that execute in this order:

  1. Actions to do with the old tool before it is released - macro name: tfreeN.g where N is the tool number;
  2. (Old tool is released);
  3. Actions to do with the new tool before it is selected - macro name: tpreN.g where N is the tool number;
  4. (New tool is selected); and
  5. Actions to do with the new tool after it is selected - macro name: tpostN.g where N is the tool number.

With such implementations there is no wait for temperature stabilisation. That can be achieved by an M116 in any of the macros, of course. However be aware that recent RepRapFirmware versions does NOT run any tool change macros if the axes are not homed.

After a reset tools will not start heating until they are selected. You can either put them all at their standby temperature by selecting them in turn, or leave them off so they only come on if/when you first use them. The M0, M1, and M112 commands turn them all off. You can, of course, turn them all off with the M1 command, then turn some back on again. Don't forget also to turn on the heated bed (if any) if you use that trick.

Tool numbering may start at 0 or 1, depending on the implementation. Some implementations (those that use the M563 command to define tools) allow the user to specify tool numbers, so with them you can have tools 17, 99 and 203 if you want. Negative numbers are not allowed.

Notes

1 For RepRapFirmware, selecting a non-existent tool also removes any X/Y/Z offset applied for the old tool.

2 T? was the original form of the command, but it was changed to Tx when it was realized that the question mark character caused problems when printing through octoprint. This change was implemented in Prusa firmware 3.5.0.

3 Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 1.17b or later supports an optional P parameter to specify which macros shall be run. If it is abscent then all of the macros above will be run, else you can pass a bitmap of all the macros to be executed. The bitmap of this value consists of tfree=1, tpre=2 and tpost=4.

D: Debug codes

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

Debug codes are not active by defalut and must be defined in source code.

D-1: Endless Loop
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
---
D0: Reset
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
This command will reset the board
B: Bootloader
D1: Clear EEPROM and RESET
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
This command will clear the EEPROM and reset the board
D2: Read/Write RAM
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
This command can be used without any additional parameters. It will read the entire RAM.
Annnn: Address (0x0000-0x1fff)
Cnnnn: Count (0x0001-0x2000)
Xnnnn: Data
D3: Read/Write EEPROM
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
This command can be used without any additional parameters. It will read the entire EEPROM.
Annnn: Address (0x0000-0x0fff)
Cnnnn: Count (0x0001-0x1000)
Xnnnn: Data
D4: Read/Write PIN
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
To read the digital value of a pin you need only to define the pin number.
Parameters
Pnnn: Pin (0-255)
Fn: Function in/out (0/1)
Vn: Value (0/1)
D5: Read/Write FLASH
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
This command can be used without any additional parameters. It will read the 1kb FLASH.
Annnn: Address (0x00000-0x3ffff)
Cnnnn: Count (0x0001-0x2000)
Xnnnn: Data
E: Erase
D6: Read/Write external FLASH
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Reserved
D7: Read/Write Bootloader
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Reserved
D8: Read/Write PINDA
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
?: Read PINDA temperature shift values
!: Reset PINDA temperature shift values to default
Pnnn: Pinda temperature [C]
Znnnn: Z Offset [mm]
D9: Read/Write ADC
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Parameters
I(index): ADC channel index
I0: Heater 0 temperature
I1: Heater 1 temperature
I2: Bed temperature
I3: PINDA temperature
I4: PWR voltage
I5: Ambient temperature
I6: BED voltage
V: Value to be written as simulated
D10: Set XYZ calibration = OK
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
D12: Time
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Writes actual time in the log file.
D80: Bed check
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
This command will log data to SD card file "mesh.txt".
Parameters
E: Dimension X (default 40)
F: Dimension Y (default 40)
G: Points X (default 40)
H: Points Y (default 40)
I: Offset X (default 74)
J: Offset Y (default 34)
D81: Bed analysis
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
This command will log data to SD card file "wldsd.txt".
Parameters
E: Dimension X (default 40)
F: Dimension Y (default 40)
G: Points X (default 40)
H: Points Y (default 40)
I: Offset X (default 74)
J: Offset Y (default 34)
D106: Print measured fan speed for different pwm values
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
D2130: Trinamic stepper controller
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
Reserved
D9125: PAT9125 filament sensor
Support Marlin RepRapFirmware Klipper Prusa Buddy Repetier Smoothie Druid MK4duo
??? ??? ??? Yes ??? ??? ??? ??? ???
grbl Sprinter BFB FiveD Machinekit Redeem Teacup Yaskawa MakerBot
??? ??? ??? ??? ??? ??? ??? ??? ???
This command can be used without any additional parameters. It will read the PAT9125 values.
Parameters
?: Print values
!: Print values
R: Resolution. Not active in code
X: X values
Y: Y values
L: Activate filament sensor log

Proposed EEPROM configuration codes

BRIEFLY: each RepRap has a number of physical parameters that should be persistent, but easily configurable, such as extrusion steps/mm, various max values, etc. Those parameters are currently hardcoded in the firmware, so that a user has to modify, recompile and re-flash the firmware for any adjustments. These configs can be stored in MCU's EEPROM and modified via some M-codes. Please see the detailed proposal at M-codes for EEPROM config. (This is proposed by --AlexRa on 11-March-2011. There is currently no working implementation of the proposed commands).

Marlin uses codes M500-M503 to manipulate EEPROM values.

RepRapFirmware uses the config-override.g file on the SD card instead of EEPROM. M500 saves certain values to that file, M501 re-loads them, and M502 loads the values from config.g, ignoring config-override.g.

Sprinter has implemented the following commands to manipulate EEPROM Commit message.

Teacup uses codes M130-M136 to set, read, and save some parameters.

Replies from the RepRap machine to the host computer

All communication is in printable ASCII characters.

Messages sent back to the host computer are terminated by a newline.

The basic protocol responses look like this:

xx [line number to resend] [T:93.2 B:22.9] [C: X:9.2 Y:125.4 Z:3.7 E:1902.5] [Some debugging or other information may be here]

xx can be one of:

  • ok - The RepRap machine is ready to receive the next line from the host.
  • rs or Resend - There was a communication error and the RepRap machine is requesting a resend of the line in question. The line is specified either as N<linenumber> or N:<linenumber>. Examples: Resend: 123, Resend: N123, rs:123
  • !! or Error: or fatal: (Repetier Firmware) - There was an error. Common communication errors such as checksum mismatch, Last Line: <number> or Wrong checksum, No Checksum with line number, Last Line: <number> or Missing checksum, Line Number is not Last Line Number+1, Last Line: <number> or expected line <number1> got <number2> are recoverable and should immediately be followed by a resend. Other non-fatal errors commonly include Unknown command: "<command>" and several SD related errors such as Cannot open subdir <dir>, SD init fail, volume.init failed, openRoot failed, workDir open failed, open failed, File: <name>, error writing to file, Cannot enter subdir: <dir> and SD read error. Any other errors indicate a hardware fault that will make the RepRap machine shut down immediately after it has sent this message. They should be considered fatal by hosts.
  • wait - The RepRap machine's command buffers are empty and it is waiting for the next line from the host.
  • busy:<reason> - The RepRap machine is busy for some reason and currently cannot receive or process commands through the serial interface from a connected host. Possible reasons are: `processing` (the RepRap machine is busy with processing some lengthy command, like homing, heatup or auto leveling), paused for user (the RepRap machine is paused and awaiting an action by the user via its built in controller unit, e.g. clicking the button), paused for input (the RepRap machine is paused and waiting for input from the user via its built in controller unit, e.g. selecting a menu option). Examples: busy: processing, busy: paused for user.

The T: and B: values are the temperature of the currently-selected extruder and the bed respectively, and are only sent in response to M105. If such temperatures don't exist (for example for an extruder that works at room temperature and doesn't have a sensor) then a value below absolute zero (-273oC) is returned.

C: means that coordinates follow. Those are the X: Y: etc values. These are only sent in response to M114 and M117.

The RepRap machine may also send lines that look like this:

// This is some debugging or other information on a line on its own. It may be sent at any time.

Such lines will always be preceded by //.

The most common response is simply:

ok

When the machine boots up it sends the string

start

once to the host before sending anything else. This should not be replaced or augmented by version numbers and the like. M115 (see above) requests those.

Originally, every line sent by RepRap to the host computer except the start line was supposed to have a two-character prefix (one of ok, rs, !! or //). The machine should never send a line without such a prefix. These days, firmwares generally do not adhere to this rule and thus it should be considered obsolete.

Example of a communication error with resend request

>>> are lines sent from the host to the RepRap machine, <<< are lines sent from the RepRap machine to the host.

 >>> N66555 G1 X131.338 Y133.349 E0.0091*91
 <<< ok
 >>> N66556 G1 X131.574 Y133.428 E0.0046*92
 <<< Error:checksum mismatch, Last Line: 66555
 <<< Resend: 66556
 <<< ok
 >>> N66556 G1 X131.574 Y133.428 E0.0046*92
 <<< ok

Action commands

On the current versions of Pronterface and OctoPrint a special comment of the form:

// action:<command>

is allowed to be sent from the firmware.

As this is also a comment other hosts will just ignore these commands.

Supported commands currently are:

  • pause: Instructs the host to pause the print job
  • resume: Instructs the host to resume the print job
  • disconnect: Instructs the host to disconnect from the printer
  • cancel: Instructs the host to abort the current job
  • out_of_filament T<extruder_id>: Tells host that filament for extruder extruder_id is run out or jammed. Host should issue a pause and can offer better help to user with this. For backward compatibility it should be followed by the pause action.

Additional commands supported by a subset of hosts:

  • paused: Instructs the host that a print job under control of the printer was paused. (support: OctoPrint 1.3.9+)
  • resumed: Instructs the host that a print job under control of the printer was resumed. (support: OctoPrint 1.3.9+)
  • prompt_begin <message>: Starts the definition of a prompt dialog. <message> is the message to display to the user. (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)
  • prompt_choice <text>: Defines a dialog choice with the associated <text>. (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)
  • prompt_button <text>: Same as prompt_choice. (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)
  • prompt_show: Tells the host to prompt the user with the defined dialog. (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)
  • prompt_end: Tells the host to close the dialog (e.g. the user made the choice through the printer directly instead of through the host). (support: OctoPrint 1.3.9+ w/ enabled Action Command Prompt support plugin)
  • probe_rewipe: Displays dialog indicating G29 Probing is Retrying. (support: Lulzbot Cura 3.6+)
  • probe_failed: Cancels print job and displays dialog indicating G29 Probing failed (support: Lulzbot Cura 3.6+)

A host can select a dialog option and finish the dialog via M876 Snnn: G-Code#M876:_Dialog_handling. It can signal support for dialogs via M876 P1.

For a more detailed example of the dialog functionality enabled through the prompt_* set of action commands, see OctoPrint's documentation.

Further notes

1. Marlin 1.0.0 Gen6 Firmware does not follow the two character rule. 'rs' is actually 'Resend' and '!!' is 'Error'. Example Lines:

  • Error: Line Number is not current line + 1. Last Line: 7
  • Resend: 8
  • Writing to File: print.gco
  • Done saving file.
  • File opened:print.gco Size:22992
  • File selected

When in the code base did this change take place and what other firmwares are affected?

2. RepRapFirmware responds to some commands with a reply string in JSON format, terminated by a newline. This allows later firmware revisions to include additional information without confusing clients (e.g. PanelDue) that do not expect it, and to make responses self-describing so that the client will not be confused if responses are delayed or lost. The commands affected are:

  • M105 S2 (now deprecated in favour of M408)
  • M105 S3 (now deprecated in favour of M408)
  • M20 S2
  • M36
  • M408

Proposal for sending multiple lines of G-code

So far, this is a proposal, open for discussion.

Problem to solve

When using Marlin firmware or emulating Marlin, each line of G-code sent from the host to the controller is answered with an ok before the next line can be sent without locking communications up. This slows down communication and limits the number of commands that can be sent per second to the printer controller, as the USB stack on the host and the serial interface driver on the Arduino add their own latencies (up to 10 milliseconds). This is not a problem for other controller electronics using native USB such as the Duet, because the standard serial-over-USB drivers provide flow control, so the host software can be configured so as not to wait for the ok.

For more details on this proposal, some suggested solutions and comments, please see GCODE_buffer_multiline_proposal

Alternatives to G-code

Main article: Firmware/Alternative#alternatives to G-code

Several people have suggested using STEP-NC or some other control language; or perhaps designing a completely new control language.