G-коды

Материал из Энциклопедия ТриДэшники
Перейти к навигации Перейти к поиску

Эта страница пытается описать все разнообразие "G-кодов", используемые в RepRap прошивках. Коды для перемещения печатающие головки взяты с NIST RS274NGC G-code standard, поэтому RepRap прошивки вполне пригодны для постройки ЧПУ станков и аналогичных устройств. Смотрите так же История G-кодов.

Есть несколько способов подготовить G-код для 3D принтера. Одним из способов является использование "слайсера", например Slic3r, Skeinforge или Cura. Данные программы берут CAD модель, нарезают ее на слои, и формируют G-код для каждого слоя. "Слайсинг" самый простой способ перейти от 3D-модели к напечатанному изделию, но при их использовании пользователь приносит в жертву некоторую гибкость. Еще один вариант для создания G-кодов является использование более низкоуровневых библиотек, таких как mecode. Библиотеки mecode дают вам точный контроль над траектории движения инструмента, она может быть полезна при печати сложных и ответственных моделей, когда обычные "слайсеры" не справляются с поставленной задачей. Последним и самым трудоемким способом является написание g-кода самостоятельно. Этот способ может быть полезен при печати простых моделей на этапе тестирования и калибровки 3D принтера.

Поскольку существует много различных прошивок, реализующие новые или специфические функции была создана основная страница RepRap кодов. Целью которой является предотвращение повторного использования одних и тех же g-кодов для двух разных задач. Из за большого числа пользователей и разработчиков существует правило: добавь новый код сюда, а затем реализуй его.

Но человеческая природа такова, что не всегда это делается согласно общепринятым правилам. В таких случаях правило гласит, что более поздние публикация кода на этой странице является устаревшей и должна быть изменена, если нет на то более веской причины, например общий стандарт g-кодов. Обратите внимание, что основной датой является дата публикации здесь, а не дата реализации.

Содержание

Введение

Типичный кусок G-кода, для RepRap 3D принтера выглядит следующим образом:

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-кодов в начало и конец файла для выполнения определенных действий до и/или после печати, таких как калибровка рабочей зоны, нагрев/ охлаждение нагревательного стола и печатающей головки (HotEnd), выполние скрипта вытирания "соплей" перед старом печати и многое другое. Более подробную информацию на страницах: Стартовый G-код и Финишный G-код.

Чтобы выяснить, какие G-коды поддерживаются в каждой из прошивок, представлена таблица, прикрепленная в описание к каждой команде:

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да automatic Нет Частично Экспериментально deprecated ??? ??? ??? ??? Да Частично

Обозначения:

{{yes}}
G-код полностью поддерживается программно-аппаратными средствами.
{{partial}} or {{experimental}}
Частичная поддержка G-кода. Часто требуется проверка исходного кода прошивки или переключать конфигурационные переключатели на материнской плате.
{{automatic}}
Встроенное программное обеспечение обрабатывает этот G-код автоматически, так что нет никакой необходимости посылать данную команду. Примером может служить включение/выключение питания, командой M80 / M81 в прошивке Teacup.
{{???}}
Не известно поддерживает ли данный G-код прошивка. Вы можете проверить это самостоятельно, прежде чем его использовать.
{{no}}
Прошивка не поддерживает данный G-код.
{{deprecated}}
Прошивка конфликтует с этом G-кодом. Автору(ам) прошивки следует изменить устаревший G-код в последней поддерживаемой версии прошивки.

Синтаксис (Fields)

RepRap G-код представляет собой список строк, разделенных пробелами или разрывом строки. Строка может быть воспринята как команда, параметр или использована для любого другого цели. каждая строка состоит из одной буквы с числом, написанными слитно, или может быть использована как флаг. В файле содержится информация о значении строки (см список ниже в этом разделе). Числа могут быть целыми (128), или дробными (12.42), в зависимости от контекста. Например, координата Х может принимать целые значения ( 'x175' ) или дробные ( 'X17.62' ), но выбор порядкового номера экструдера 2,76 будет бессмысленным. В этом описании числа в строке (команде) представлены в виде 'nnn' .

В RepRap прошивках некоторые параметры могут состоять из нескольких отдельных цифровых значений, разделенных двоеточием. Как правило, это используется для задания параметров нескольких экструдеров. Если установлено лишь одно значение, без разделения двоеточием, то это значение применяется ко всем экструдерам.


Команда Описание
Gnnn Стандартная команда, переход к заданной точке
Mnnn RepRap- ориентированные команды. Например включение вентилятора
Tnnn Выберите инструмент NNN. В RepRap, инструмент, как правило, ассоциируется с соплом или печатающей головкой, которая может работать с одиним или более экструдеров.
Snnn Команды, такие как время в секундах; температура; напряжение.
Pnnn Команды, такие как время в миллисекундах; для задания значений Kp для настройки ШИМ (PID)
Xnnn Координата X, используется обычно для перемещения по данной координате. Может быть целым или дробным числом.
Ynnn Координата Y, используется обычно для перемещения по данной координате. Может быть целым или дробным числом.
Znnn Координата Z, используется обычно для перемещения по данной координате. Может быть целым или дробным числом.
U,V,W Дополнительные координатные оси (в RepRap прошивках)
Innn Параметр смещения координаты Y при движении по дуге. Или для задания значений Ki для настройки ШИМ (PID)
Jnnn Параметр смещения координаты Y при движении по дуге
Dnnn Параметр используется для задания диаметра. Или для задания значений Ki для настройки ШИМ (PID)
Hnnn Параметр используемый для выбора номера печатающей головки для ШИМ (PID) регулирования
Fnnn Скорость подачи в мм в минуту. (Скорость движения печатающей головки)
Rnnn Параметр используемый для задания температуры
Qnnn Не используется в настоящее время
Ennn Длина экструдирования (выдавливания пластика). Используется и задается так же как для координат X, Y и Z, но применима к длине нити.
Nnnn Номер строки. Используется для запроса повторной передачи в случае возникновения ошибок.
*nnn Контрольная сумма. Используется для проверки на наличие ошибок.

Комментарии

G-код комментария начинается с точки с запятой, и заканчивается в конце строки:

N3 T0*57 ; Это комментарий
N4 G92 E0*67
; Это тоже комментарий
N5 G28*22

Комментарии и пробелы будут игнорироваться RepRap принтером. Лучше убрать их из файла перед отправкой G-кода на принтер, так как это экономит полосу пропускания.

Специальные символы

N: Номер линии

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да ??? Да Да ??? ? Да Да

Пример: N123

Если присутствует, то номер строки должен стоять в начале строки. Для G-кода, хранящегося на SD картах номер строки обычно опускается.

Если функция включена, то RepRap прошивка считает, что номер строк увеличится на 1, и если этого не произойдет оно выдаст ошибку. Но вы можете сбросить счетчик с помощью команды M110 (смотри ниже).

*: Контрольная сумма

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да ??? Да ??? ??? ? Нет Да

Пример: *71

Если команда присутствует, контрольная сумма должна быть последним полем в строке, но перед комментарием. Для G-кода, хранящегося SD картах контрольная сумма обычно опускается.

Если проверка поддерживается, то RepRap сверяет контрольную сумму с локально вычисленным значением и если они отличаются, повторно запрашивает строку с данным номером.

Проверка

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да ??? Да ??? ??? ? Нет Да

Пример N123 [...произвольный G-код...] *71

RepRap прошивка проверяет номер строки и контрольную сумму. Вы можете пропустить оба этих параметра, но в таком случае прошивка не сделает проверку. Если передается только один параметр, прошивка выдает ошибку. Должны быть заданы обе переменные.

Контрольная сумма "CS" для строки G-кода "cmd" (включая номер его строки) вычисляет путем исключение байтов в строке до символа * следующим образом:

int cs = 0;
for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++)
   cs = cs ^ cmd[i];
cs &= 0xff;  // Безопасное программирование...

и значение прибавляет как десятичное целое число к команде после *.

Буферизация

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да ??? Да ??? ??? Да ??? ??? Да Да Да

Если буферизация поддерживается, прошивка сохраняет некоторый объем g-команд во временную память, буфер для последующего выполнения. Это позволяет избежать заметных задержек при передаче данных. Как только поступает команда она буферизируется и хранится локально до ее выполнения. Если локальный буфер заполнен, то получение команд откладывается до тех пор пока не освободится буфер. Таким образом достигается управление потоком данных.

Как правило, буферизируются команды движения (перемещения): G0-G3 и G28-G32. Teacup Firmware буферезируются так же некоторые команды настроек: G20, G21, G90 и G91. Все остальные команды G, M или T не сохраняются в буфере.

RepRap прошивки также организуют внутреннюю очередь, чтобы гарантировать, что некоторые G-коды (например, M106) выполнялись в правильном порядке, а не произвольном. Эта функция недоступна в RepRapFirmware-dc42.

Когда небуферизованная команда получена она сохраняется, но оно не будет выполнена, пока буфер не будет исчерпан, и только после этого команда будет выполнена. Таким образом, контроллер остановится на одной из этих команд, пока не выполнит его. Короткие паузы между этими командами и любые, следующие за ними, не влияют на производительность.

G-команды

G0 & G1: Перемещение

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да Да Да Да Да
  • G0 : Быстрое (холостое) линейное перемещение
  • G1 : Линейное перемещение
Использование
G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn
G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn
Parameters
Не все параметры могут быть использованы, но по крайней мере один должен быть задан
Xnnn Позиция для перемещения по оси X
Ynnn Позиция для перемещения по оси Y
Znnn Позиция для перемещения по оси Z
Ennn Количество пластика, которое нужно выдавить между начальной и конечной точкой перемещения
Fnnn Скорость перемещения в минуту между начальной и конечной точкой
Snnn Флаг для проверки срабатывания концевых выключателей EndStop (S1 проверить, S0 игнорировать, S2 смотри примечания, по умолчанию S0)1
Пример
G0 X12 (переместится на 12 мм по оси X)
G0 F1500 (Установить скорость перемещения равной 1500 мм/мин.)
G1 X90.6 Y13.8 E22.4 (Переместиться на 90.6 мм по оси X и на 13.8 мм по оси Y в тоже время выдавить 22.4 мм материала.)

RepRap прошивки одинаково воспринимают команды G0 и G1, так как разница между ними не велика 2

1. G1 F1500
2. G1 X50 Y25.3 E22.4

В вышеупомянутом примере мы устанавливаем скорость перемещения в 1500 мм/минуту в первой строке, затем с этой заданной скоростью перемещаемся на 50 мм по Оси X и на 25.3 мм по Оси Y, выдавливая 22.4 мм нити между двумя точками.

1. G1 F1500
2. G1 X50 Y25.3 E22.4 F3000

Однако в данном примере, в первой строке мы устанавливаем скорость перемещения в 1500 мм/минуту, но перемещаемся по координатам уже со скоростью 3000 мм/минуту так как мы задали новую скорость в конце второй строки.

RepRap специально рассматривает скорость перемещения как переменную (например, X, Y, Z и E), чтобы линейно интерполировать данное значение. Это дает полный контроль над ускорением и замедлением головки принтера, чтобы обеспечить плавное синхронное движение, а так же равномерно выдавливать необходимый объем пластика. 3

Для реверса экструдера (ретракта) на заданную величину (например, чтобы уменьшить внутреннее давление пластика в печатающей головки во время холостого перемещения, во избежания потеков пластика - "соплей") просто используются команды G0 или G1, чтобы передать значение Е, который меньше, чем значения величины выдавленного пластика.


Пояснения

1Некоторые прошивках позволяют включить или отключить функцию слежения за концевыми выключателями во время движения. Пожалуйста, проверьте корректно ли ваша прошивка работает с данными командами, так как неправильная работа данных команд может привести к поломкам. В RepRap прошивках, на дельта принтере используются параметры S1 или S2 для вызова параметров XYZ используются для обозначения положений башен двигателей вместо положения головы, а также для того, чтобы включить срабатывание концевых выключателей, при параметре S1.

2В RS274NGC Spec, G0 является Быстрым перемещением , которая была использован для перемещения между текущей точкой в ​​пространстве и новой точкой максимально быстро и эффективно, насколько это возможно. А G1 является Контролируемым перемещением , которая была использована для перемещения между текущей и новую точкой как можно точнее.

3Некоторые прошивках могут не поддерживать настройки скорости подачи, написанные в одной строчке с командами перемещения.

4В RepRap прошивках предусмотрен дополнительный параметр 'R1', чтобы сообщить принтеру, чтобы он вернулся к координатам на которых печать была ранее приостановлена. Если этот параметр используется и код содержит буквы оси, смещение будет добавлено к координатам паузы (например, G1 R1 Z5).

Некоторые старые машины, ЧПУ или любые другие, использует для быстрого перемещения движение не по прямой линии. Это также верно для некоторых не декартовых принтеров, например дельта или полярные принтеры, которые движутся быстрее и легче в кривой.

G2 & G3: Контроль криволинейного движения

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да1 Да Да Нет Да ??? Да Экспериментально Да
Использование
G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn (Дуга по часовой стрелке)
G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn (Дуга против часовой стрелке)
Параметры
Xnnn Позиция для перемещения по оси X
Ynnn Позиция для перемещения по оси Y
Innn The point in X space from the current X position to maintain a constant distance from
Jnnn The point in Y space from the current Y position to maintain a constant distance from
Ennn Количество пластика, которое нужно выдавить между начальной и конечной точкой перемещения
Fnnn Скорость перемещения в минуту между начальной и конечной точкой (если поддерживается)
Пример
G2 X90.6 Y13.8 I5 J10 E22.4 (Переместится по часовой стрелке от начальной точки (X=90.6,Y=13.8), с центром в точке (X=current_X+5, Y=current_Y+10), выдавить 22.4 мм материала между началом и концом движения)
G3 X90.6 Y13.8 I5 J10 E22.4 (Переместится против часовой стрелке от начальной точки(X=90.6,Y=13.8), с центром в точке (X=current_X+5, Y=current_Y+10), выдавить 22.4 мм материала между началом и концом движения)
Примечание

1В Marlin прошивке не реализовано для 'DELTA' и 'Scara' принтеров.

G4: Ожидание (Пауза)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да Да Да Да Да

Pause the machine for a period of time.

Parameters
Pnnn Время ожидания, в миллисекундах
Snnn Время ожидания в секундах (только на RepetierFirmware, 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
Нет Нет Нет Нет Нет Нет Нет Нет Нет Нет Нет Нет

Прямое не интерполированное и не синхронизированное (кинематически) управление одним или несколькими шаговыми двигателями. Переменные могут быть в линейных единицах измерения (например, мм или дюймах на <код> DELTA </ код>) или в градусах (SCARA). Эта команда полезна для инициализации, диагностики и калибровки, после чего должна быть отключена в штатном режиме работы. Этот тип перемещения может быть потенциально опасным, особенно для delta робота, поэтому должно быть сделано все возможное, чтобы ограничить пределы перемещения, для предотвращения вибраций и ударов частей принтера (тверкинг) и их предотвратить их повреждение.


Параметры
Annn Количество шагов или угол поворота оси (привода) A
Bnnn Количество шагов или угол поворота оси (привода) B
Cnnn Количество шагов или угол поворота оси (привода) C
R Флаг относительного движения
Пример SCARA робота
G6 A45 ; перемещение оси A в SCARA роботе на угол 45°
G6 B20 R ; перемещение оси B в SCARA роботе на угол 20° по часовой стрелке
Пример DELTA робота
G6 C10 R ; Перемещение каретки DELTA робота по оси C на 10мм

G10: Смещение инструмента (печатающей головки)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Да ??? ??? Нет Нет
Использование
G10 Pnnn Xnnn Ynnn Znnn Rnnn Snnn1
Параметры
Pnnn Номер инструмента (сопла)
Xnnn смещение по оси X
Ynnn смещение по оси Y
U,V,Wnnn смещение осей U, V и W 5
Znnn смещение по оси Z 2
Rnnn температура в режиме ожидания(s)
Snnn Активная температура(s)
Пример
G10 P2 X17.8 Y-19.3 Z0.0 (устанавливает смещение для инструмента (или в старых реализациях печатающая головка) значения X, Y и Z определены. )
G10 P1 R140 S205 (установка режима ожидания с поддержанием температуры3 для первой печатающей головки)

Помните, что любой параметр, который вы не укажете, автоматически примет последнее известное значение. Это означает, что вы хотите установить Z0.0. RepRap прошивка назначит параметры инструмента, только если указан номер инструмента.

Значение R установка температуры в режим ожидания в градусах Цельсия оС, который будет применены для Печатающей головки (HotEnd), а значение S является его текущей температурой. Если вы не хотите, чтобы печатающая головка меняла температуру в режиме ожидания, установите оба значения одинаковыми. Смотрите T-код (выбор инструмента) ниже. В случаях с несколькими обогревательными элементами для них параметры задаются следующим образом: R100.0: 90,0: 20,0 S185.0: 200,0: 150,0.


Смотрите так же M585.

Примечания

1 Marlin использует G10 / G11 для выполнения отката / подачи. Версия RepRapPro Марлин поддерживает G10 для коррекции инструмента (печатающей головки). Smoothie использует G10 для ретракта и G10 Ln для установки координат рабочей области.

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.

G10: Откат пластика (Ретракт)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да: 0.92 Да dc42,ch Нет ??? ??? Нет Да
Параметры
Snnn длинна отката (S1 = длинный откат, S0 = короткий откат = по умолчанию) (только RepetierFirmware)
Пример
G10

Откат нить в соответствии с настройками M207 (Marlin, RepRapFirmware) или в соответствии со значением S (Repetier).

RepRapFirmware распознает команду G10 в качестве команды, чтобы установить смещение инструмента и / или температуры, если параметр Р присутствует, и как команду отката, если данная переменная отсутствует.


G11: Подача пластика

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да: 0.92 Да dc42,ch Нет ??? ??? Нет Да
Параметры
Snnn длинна отката (S1 = длинный откат, S0 = короткий откат = по умолчанию) (только RepetierFirmware)
G11

Подача / восстанавливает положение пластика в соответствии с настройками M208 (Marlin, RepRapFirmware) или в соответствии со значением S (Repetier).

G17..19: Выбор плоскости (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? Нет ??? ??? Нет Да ??? Да Нет Нет

Эти коды установить текущую плоскость следующим образом:

  • G17 : XY (по умолчанию)
  • G18 : ZX
  • G19 : YZ

G20: Установка единиц измерения в дюймах

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да ??? Да Нет Да
Пример
G20

С этого момента отсчет будет вестись в дюймах.

G21: Установка единиц измерения в миллиметрах

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да ??? Да Да Да
Пример
G21

С этого момента отсчет будет вестись в миллиметрах. (По умолчанию для RepRap)

G22 & G23: Откат (ретракт)/подача средствами прошивки

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Да ??? ??? Нет Нет
Usage
G22 ; Откат
G23 ; Противооткат/Подача

Реализуется прошивкой для выполнения отката/подачи, вместо того, чтобы генерировать слайсером движение оси E (подачи экструдера) командой G1. Длинна отката/подачи и скорость реализуется программно-аппаратными средствами.

G28: Перемещение в начало ("домой")

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да Да Да Да Да1
Параметры
Эта команда может быть использована без каких-либо дополнительных параметров.
X Флаг, чтобы переместится к началу по оси X
Y Флаг, чтобы переместится к началу по оси Y
Z Флаг, чтобы переместится к началу по оси Z
Пример
G28     ; Перемещение в начало всех осей
G28 X Z ; Перемещение в начало по осям X и Z

Когда прошивка принимает эту команду, она быстро перемещает указанные оси (или все оси, если не переданы параметры) к концевым выключателям, отступает от каждого концевого выключателя на небольшое расстояние, и медленно подходит к концевикам, данный метод позволяет повысить точность позиционирования. Этот процесс, известный как " Возврат в исходное положение, необходимо, чтобы определить положение кареток. Некоторые прошивки могут запретить движение за пределы концевых выключателей или запретить любые другие операции, пока не будет выполнена команда G28.

'X' , 'Y' и 'Z' параметры действуют только в качестве флагов. Любые вводимые координаты игнорируются. Например, G28 Z10 выполнится так же как и G28 Z. Delta принтеры не имеют домашнего положения по каждой из осей, отдельный их запуск может привести к краху механики. На данных принтерах в исходное положение должны двигаться все три оси одновременно.

Marlin прошивка (версия 1.1.0 и выше) имеет функцию под названием Z_SAFE_HOMING для принтеров, которые используют Z щуп (механизм калибровки) для возврата в исходное положение вместо концевого выключателя. С помощью этой опции, оси XY возвращаются в исходное положение первыми, а затем ось Z безопасно приближается к соплу.

RepRapFirmware использует макро-файлы для возврата в исходное положение всех осей или отдельных осей. Для всех осей используется файл homeall.g. Для отдельных осей ''homex.g, homey.g, или homez.g. На Delta принтерах, команда G28 всегда будет возвращать в исходное положение все три оси, вне зависимости от параметров X Y Z и использует файл homedelta.g.

Поскольку команда G28 специфична, не включайте ее в конец вашего g-кода. В принтерах с декартовой системой координат при подаче команды G28, все оси поедут в исходное положение и могут задеть напечатанную модель, или вообще повредить механические части. Лучше задавайте координаты перемещения осей в конце печати явно, используя команды: G0 или G1

Примечания

1 MK4duo имеет параметр B, который сообщает принтеру, что необходимо вернуться к последним координатам до возврата в исходное положение.

G29: Полная авто калибровка

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да: 0.91.7 Нет, see G32 Да, 1.17 and later Да ??? ??? Да Да

Эта команда использует щуп для измерения высоты стола в 3-х или более точках, чтобы определить его наклон и общую ровность. Затем принтер корректирует положение головки относительно стола. Оси принтера должны быть в начальном положении, команда G28, перед тем как запускать авто калибровку.

Каждая прошивка ведет себя по-разному и калибровка зависит от настроек и заложенного алгоритма. Например, Marlin 1.0.2 обеспечивает 3 различных типов автоматического выравнивания слоя и вариант ручного выравнивания стола. Смотрите документацию по каждой прошивке, что бы корректно настроить свой принтер.


Использование
G29
G29 Snnn
Параметры
Snnn зависит от поведения прошивки
Pfile.csv национальный параметр имени файла карты высот (только для прошивки RepRapFirmware)
Пример
G29    ; Калибровка стола и включение компенсации кривизны
G29 S2 ; специальный оператор, смотри документацию
G29 Авто калибровка в прошивке Marlin

Marlin 1.0.2 и более ранние версии поддерживают три варианта автоматической калибровки стола:

  • По 3-ем точкам для корректировки наклона стола.
  • Метод планарной сетки (не поддерживается Дельта принтеры). Калибровка по сетке для получения матрицы с последующей корректировкой кривизны и наклона стола по методу "наименьших квадратов"
  • Метод билинейной сетки (только Дельта принтеры). Калибровка по сетке, с помощью билинейной интерполяции для корректировки неровной кровати.

Marlin 1.1.0 и выше использует метод билинейной сетке, который будет использоваться на всех типах механик, а не только на Дельтах. Это предпочтительный путь развития

G29 Ручная калибровка в Marlin

В прошивке Marlin (версия 1.0.2 и выше) устанавливается параметром MESH_BED_LEVELING. Используется на принтерах, без датчика авто калибровки. Эта функция выравнивания стола компенсирует неровности оси Z поперек поверхности слоя с использованием сетки и билинейной интерполяции.

Использование ручной калибровки стола
G29 S1 ; Переход к первой точке и ждать замер 
G29 S2 ; Сохранить положение данной точки по оси Z, и перейти к следующей 
G29 S3 Xn Yn Zn.nn ; Изменение высоты одной точки
Опции для параметра S
S0 Произвести замер сетки
S1 Начать замер точек карты
S2 Замер следующей точки
S3 Xn Yn Zn.nn Вручную изменить одну точку
S4 Zn.nn Установить смещение оси z. положительное значение от стола, отрицательно - ближе к столу
G29 in Repetier firmware

Repetier firmware since v0.91 supports G29 with the optional Snnn parameter as described below. Useful to simply detect the Z bed angle so you can manually readjust your bed and get it as close to in plane as possible. If you wish to apply automatic software Z plane compensation on Repetier, use G32 instead with firmware 0.92.8 and above.

S0 Default value. Z bed heights are calculated at the measured points, relative to current Z position before issuing G29.
S1 Same as S0, except printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue G28 Z to home to Z maximum position before issuing G29 Snnn for this to work correctly, or the printer height will be invalid.
S2 Same as S1, except new calculated Z height is also stored to EEPROM.
G29 in RepRapFirmware

RepRapFirmware:

S0 (default if no S parameter) Probe the bed, save the height map in a file on the SD card, and activate bed compensation. The default folder for the height map file is /sys and the default file name is heightmap.csv.
S1 Load the height map from file and activate bed compensation. The default folder and filename as for S0.
S2 Clear bed height map

To define the grid, see M557.

G29.1: Настройка положения щупа Z

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Да ??? ??? Нет Нет
Пример
G29.1 X30 Y20 Z0.5

Установка положения устройства авто-калибровки (щупа) оси Z относительно сопла. Смещение будет вычисляться по всем осям.

G29.2: Set Z probe head offset calculated from toolhead position

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Да ??? ??? Нет Нет

Example: G29.2 Z0.0

Set the offset of the Z probe head. The offset will be subtracted from all probe moves. The calculated value is derived from the distance of the toolhead from the current axis zero point.

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

G30: Single Z-Probe

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use G28 & G92 Нет Да Да Да Да Да ??? ??? Да Да1
Usage
G30 Pnnn Xnnn Ynnn Znnn Hnnn Snnn
Parameters
Pnnn Probe point number
Xnnn X coordinate
Ynnn Y coordinate
Znnn Z coordinate
Hnnn Height correction
Snnn Set parameter
Examples
G30
Examples (RepRapFirmware)
G30 ; Probe the bed at the current XY position. When the probe is triggered, set the Z coordinate to the probe trigger height.
G30 S-1 ; Probe the bed at the current XY position. When the probe is triggered, do not adjust the Z coordinate.
G30 P0 X20 Y50 Z-99999 ; Probe the bed at X20 Y50 and save the XY coordinates and the height error as point 0
G30 P3 X180 Y180 Z-99999 S4 ; Probe the bed at X180 Y180, save the XY coordinates and the height error as point 3 and calculate 4-point compensation or calibration
G30 P3 X180 Y180 Z-99999 S-1 ; As previous example but just report the height errors

In its simplest form probes bed at current XY location.

RepRapFirmware supports additional 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 or for performing delta printer calibration. 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 specified (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.

RepRapFirmware uses the value of the S parameter to specify what computation to perform. If the value is -1 then the Z offsets of all the points probed are printed, but no calibration is done. If the value is zero or not present, then this specifies that the number of factors to be calibrated is the same as the number of points probed. Otherwise, the value indicates the number of factors to be calibrated, which must be no greater than the number of points probed. In version 1.09, the number of factors may be 3, 4 or 5 when doing auto bed compensation on a Cartesian or CoreXY printer, and 3, 4, 6 or 7 when doing auto calibration of a Delta printer.

RepRapFirmware supports an optional H parameter, which is a height correction for that probe point. It allows for the Z probe having a trigger height that varies with XY position. The nominal trigger height of the Z probe (e.g. at bed centre) is declared in the Z parameter of the G31 command in the config.g file. When you probe using G30 and the probe triggers, the firmware will assume that the nozzle is at the nominal trigger height plus the value you have in the H parameter.

1MK4duo Firmware support an optional parameter for Autocalibration Delta.

Usage
G30 Xnnn Ynnn Znnn Annn E R I D T S U
Parameters
Xnnn X coordinate
Ynnn Y coordinate
Znnn Z coordinate
Annn A Autocalibration width nnn precision
E Adjust Endstop
R Adjust Endstop & Delta Radius
I Adjust Tower
D Adjust Diagonal Rod
T Adjust Tower Radius
Sn Stows the probe if 1 (default=1)
Un <bool> with a non-zero value will apply the result to current zprobe_zoffset

G31: Set or Report Current Probe status

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да: 0.91.7 Да Да Нет ??? ??? Нет Нет
Usage
G31 Pnnn Xnnn Ynnn Znnn Cnnn Snnn
Parameters
Pnnn Trigger value
Xnnn Probe X offset1
Ynnn Probe Y offset1
Znnn Trigger Z height
Cnnn Temperature coefficient2
Snnn Calibration temperature2
Examples
G31 P500 Z2.6
G31 X16.0 Y1.5

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 RepRapFirmware, separate G31 parameters may be defined for different probe types (i.e. 0+4 for switches, 1+2 for IR probes and 3 for alternative sensors). To specify which probe you are setting parameters for, send a M558 command to select the probe type before sending the G31 command.

In Repetier, G31 supports no parameters and simply prints the high/low status of the Z probe.

Notes

1X and Y offsets of the Z probe relative to the print head (i.e. the position when the empty tool is selected) can be specified in RepRapFirmware. This allows you to calculate your M557 probe coordinates based on the geometry of the bed, without having to correct them for Z probe X and Y offset. It also provides more accurate bed compensation.

2In RepRapFirmware, additional parameters 'S' (bed temperature in oC at which the specified Z parameter is correct, default is current bed temperature) and 'C' (temperature coefficient of Z parameter in mm/oC, default zero) can be set for the alternative (ultrasonic) sensor. This is useful for probes that are affected by temperature.

G31: Стыковка с механизмом авто калибровки

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? Нет Нет Нет ??? ??? Да Да

G32: Probe Z and calculate Z plane

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет: See G29 Да: 0.92.8 Да Да Нет ??? ??? Нет Нет
Usage
G32
G32 Snnn
Parameters
Snnn Store transformation matrix after probing1
Examples
G32
G32 S2

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

RepRapFirmware executes macro file bed.g if present instead of using the M557 coordinates.

Notes

1Currently only Repetier firmware v0.92.8 and higher have working support for an optional Snnn parameter. The numeric value sets the behavior that occurs immediately after point probe and transformation matrix calculation:

S0 Default value. Transformation matrix is updated in RAM but is not stored to EEPROM. Z bed height not calculated.
S1 Transformation matrix is updated in RAM but is not stored to EEPROM. Printer immediately moves to Z maximum position (Z max endstop required!), and calculates new Z maximum height. You must first issue G28 to home to Z maximum position before issuing G32 Snnn for this to work correctly, or the printer height will be invalid.
S2 Same as S1, except transformation matrix and Z max heights are also stored to EEPROM.
S3 Transformation matrix is stored to EEPROM. Z bed height not calculated.

G32: Расстыковка с механизмом авто калибровки

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? Нет Нет Нет ??? ??? Да Да

G33: Замер/вывод/корректировка карты неровностей

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да: v0.92.8 Нет Нет Нет ??? ??? Да Нет
Использование
G33
G33 Lnnn
G33 Rnnn
G33 Xnnn Ynnn Znnn
Параметры
L0 Вывод карты неровностей
R0 Сброс карты неровности
X<pos> Y<pos> Z<zCorrection> установка значений корректировки ближайших точек
Пример
G33
G33 R0

При использовании без параметров G33 будет измерять сетку точек и сохранять искажения (возвышенности и впадины) на поверхности стола, а затем включит программную корректировку искажений первых или всех слоев. Значения будут сохранены в EEPROM, если она включена в прошивке. Вы должны предварительно подать команду G28 для старта измерений с начала координат, и минимальная / максимальная высота должна быть правильно установлена. С помощью дополнительных параметров вы можете вывести список (таблицу замеров), сбросить или внести изменения. Корректировка может быть позже включена или выключена с помощью команды M323.

G38.x Прямое зондирование (механическое сканирование) (Часто применяются в чпу)

G38.2 Касание о деталь, остановка по контакту, ошибка при отсутствии сигнала
Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? Да: 1.1.0 ??? Да Нет ??? ??? Да Нет Нет
G38.3 Касание о деталь, остановка по контакту
Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? Да: 1.1.0 ??? Да Нет ??? ??? Да Нет Нет
G38.4 Касание от детали, остановка при потере контакта, ошибка при отсутствии сигнала
Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? Нет ??? ??? Да Нет Нет
G38.5 Касание от детали, остановка при потере контакта
Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? Нет ??? ??? Да Нет Нет

G40: Compensation Off (CNC specific)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? Нет Да ??? Да Нет Нет

G40 turn cutter compensation off. If tool compensation was on the next move must be a linear move and longer than the tool diameter. It is OK to turn compensation off when it is already off.

G54..59: Выбор системы координат (Часто применяются в ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? Да Нет Да ??? Да Нет Нет

Подробнее смотри: linuxcnc.org

G60: Сохранить текущую позицию в ячейку памяти

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? Да
Применение
G60 Snn
Парамтеры
Snn <nn> определяет ячейку памяти # (0-based) для сохранения в память (default 0)

G61: Применить / восстановить сохранную позицию (координаты) активного экструдера.

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? Да
Использование
G61 Xnnn Ynnn Znnn Ennn Fnnn Snn
Параметры
Xnnn X координата
Ynnn Y координата
Znnn Z координата
Ennn E координата
Fnnn F установить скорость подачи
Snn S установить ячейку памяти # (0-based)

G80: Cancel Canned Cycle (CNC specific)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? Нет ??? ??? Да Нет Нет

It cancel canned cycle modal motion. G80 is part of modal group 1, so programming any other G code from modal group 1 will also cancel the canned cycle.

G90: Установка абсолютных координат

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да Да Да Да Да

Пример: G90

Все координаты являются абсолютными относительно начала координат станка. (По умолчанию в RepRap)

G91: Установка относительных координат

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да Да Да Да Да

Пример: G91

Все координаты с этого момента становятся относительными по отношению к последней позиции. Примечание: В последней редакции RepRap прошивки используется M83 для установки экструдера в относительных координатах. Экструдер(ы) не устанавливаются в относительные координаты по команде G91, она справедлива только для осей X, Y, Z. В отличии от данной прошивки, например Марлин переводит все оси в относительные координаты, в том числе экструдер.

G92: Установить позицию

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да Да Да Да Да
Параметры
Эта команда может быть использована без каких-либо дополнительных параметров.
Xnnn новая координата X
Ynnn новая координата Y
Znnn новая координата Z
Ennn новая позиция экструдера
Пример
G92 X10 E90

Позволяет программировать позицию абсолютного нуля, сбрасывая текущую позиции до заданных значений. В примере координате X назначено значение 10, а экструдеру - 90. При этом не будет происходить фактического перемещения осей.

Команда G92 без параметров сбросит все координаты осей на ноль.

G92.x: Сброс координат смещений (CNC specific)
Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? Да Нет ??? ??? Да Нет Нет
  • G92.1 - Сброс смещения осей до нуля и установит параметры 5211 - 5219 в ноль. (X Y Z A B C U V W)
  • G92.2 - Сброс смещения осей до нуля.

G93: Установка режима подачи (период времени или частота) (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? Нет ??? ??? Да Нет Нет

В данном режиме скоростной подачи данное значение - F означает, что действие должно завершится в течении заданного времени (периода) Например, если число F = 2.0, этот шаг должен быть завершен за полминуты.

Когда частотный режим скоростной подачи активен, то F слово должно устанавливаться в каждой строке, которая имеет G1, G2, G3 или любого другого движения. Но данный режим не влияет на команду холостого перемещения G0.

G94: Установка режима подачи (Единиц в минуту) (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? Нет ??? ??? Да Нет Нет

G94 устанавливает подачу в мм (дюймах; градусах) за единицу времени (минуту).

G100: Calibrate floor or rod radius

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да: 0.92 Нет Нет Нет ??? ??? Нет Нет
Parameters
X Flag to set floor for X axis
Y Flag to set floor for Y axis
Z Flag to set floor for Z axis
Rnnn Radius to add
Examples
G100 X Y Z (set floor for argument passed in. Number ignored and may be absent.)
G100 R5 (Add 5 to radius. Adjust to be above floor if necessary)
G100 R0 (Set radius based on current z measurement. Moves all axes to zero)

G130: Установка значения цифрового потенциометра

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет Да ??? Нет Нет

Пример: G130 X10 Y18 Z15 A20 B12

Задание значение цифрового потенциометра для заданных осей. Данная команда используется для настройки тока, для каждого шагового двигателя. Значение задается в виде значения от 0-127; данное значение является цифровым (128 бит или 16 байт), а не аналоговым, как мы привыкли видеть, например в % или А.

G131: Удалить смещения

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да: 0.91 Нет Нет Нет ??? ??? Нет Нет

G132: Калибровка смещения концевых выключателей

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да: 0.91 Нет Нет Нет ??? ??? Нет Нет

G133: Сдвинуть шаги вверх

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да: 0.91 Нет Нет Нет ??? ??? Нет Нет

G161: Начальное положение (Парковка) в минимум

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Нет Нет Нет Нет Да ??? Нет Нет
Параметры
X Флаг, для отправки оси X в минимальную начальную позицию
Y Флаг, для отправки оси Y в минимальную начальную позицию
Z Флаг, для отправки оси Z в минимальную начальную позицию
Fnnn Желаемая скорость перемещения
Пример
G161 X Y Z F1800

Команда, отправляющая головку в начальное (домашнее) минимальное положение. Данная команда подобна G28, которая, в свою очередь, самостоятельно (согласно настройкам) определяет по каким осям двигаться в начальное положение min или max.

G162: Начальное положение (Парковка) в максимум

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Нет Нет Нет Нет Да ??? Нет Нет
Параметры
X Флаг, для отправки оси X в максимальную начальную позицию
Y Флаг, для отправки оси Y в максимальную начальную позицию
Z Флаг, для отправки оси Z в максимальную начальную позицию
Fnnn Желаемая скорость перемещения
Пример
G162 X Y Z F1800

Команда, отправляющая головку в начальное (домашнее) максимальное положение

M-commands

M0: Stop or Unconditional stop

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Нет Да Нет Нет Да Да ??? Да Нет Да
Parameters
This command can be used without any additional parameters.
Pnnn Time to wait, in milliseconds1
Snnn Time to wait, in seconds2
Example
M0

The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can be started again by pressing the reset button on the master microcontroller, although this step is not mandatory on RepRapFirmware. See also M1, M112.

The Marlin Firmware does wait for user to press a button on the LCD, or a specific time. "M0 P2000" waits 2000 milliseconds, "M0 S2" waits 2 seconds.

RepRapFirmware executes macro file stop.g before everything is turned off. Apart from that, RepRapFirmware (v1.09n-ch) accepts an extra 'H' parameter, whose value must be non-zero, to keep all heaters active. This is what Duet Web Control v1.07 sends to cancel a paused print.

Notes

1Not available in RepRapFirmware, but as a work-around G4 can be run before M0.

2Only available on Marlin.

M1: Sleep or Conditional stop

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет ??? Нет Да Нет Нет Да Нет ??? Да Нет Да
Example
M1

The RepRap machine finishes any moves left in its buffer, then shuts down. All motors and heaters are turned off. It can still be sent G and M codes, the first of which will wake it up again. See also M0, M112.

The Marlin Firmware does the same as M0.

If Marlin is emulated in RepRapFirmware, this does the same as M25 if the code was read from a serial or Telnet connection, else the macro file sleep.g is run before all heaters and drives are turned off.

M2: Конец программы

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Нет ??? Нет Нет Да Да Нет Нет

Пример: M2

Прошивка Teacup делает тоже самое командой M84.

M3: Включить шпиндель, по часовой стрелке (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Да Да Да Нет ??? Да Нет Нет
Параметры
Snnn Скорость шпинделя
Пример
M3 S4000

Шпиндель включается со скоростью 4000 оборотов в минуту (RPM).

Прошивка Teacup включает экструдер (так же, как M101).

RepRapFirmware воспринимает этот код, только если "Roland mill" был настроен.

В Repetier-Firmware в ​​режиме лазерного гравера вам необходимо установить S0..255 - интенсивность лазерного излучения. Обычно используется S255, чтобы включить его на полную мощность. Лазер будет включаться только с командами G1 G2 G3 и в режиме лазерного гравера (M452).

M4: Включить шпиндель, против часовой стрелке (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? Да Нет Нет

Пример: M4 S4000

Шпиндель включается со скоростью 4000 оборотов в минуту (RPM).

M5: Выключить шпиндель (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Да Да Нет Нет ??? Да Нет Нет

Пример: M5

Шпиндель выключается

Прошивка Teacup выключает экструдер (так же как команда M103).

M6: Смена инструмента

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Нет ??? Нет Нет ??? ??? Нет Нет

Пример: M6

M7: Включить масляный туман (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use M106 Нет Нет Нет Нет Нет Нет ??? Да Нет Нет

Пример: M7

Включить масляный туман (если такова имеется)

В прошивке Teacup включение вентилятора и установка скорости вращения (так же как M106).

M8: Включить подачу охлаждающей жидкости (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use M106 Нет Нет Нет Нет Нет Нет ??? Да Нет Нет

Пример: M8

Включить подачу охлаждающей жидкости (если имеется)

M9: Выключить систему охлаждения (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use M106 Нет Нет Нет Нет Нет Нет ??? Да Нет Нет

Пример: M9

Выключение всех систем охлаждения.

M10: Включить систему пылеулавливания (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use M106 Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Пример: M10

Включить систему пылеулавливания. (пылесос)

M11: Выключить систему пылеулавливания (Специфично для ЧПУ)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use M106 Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Пример: M11

Выключить систему пылеулавливания. (пылесос)

M17: Включить/Подать питание на все шаговые двигатели

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет (automatic) Нет Да Нет Да Нет Нет ??? ??? Да Да

Пример: M17

M18: Отключить все шаговые двигатели

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use M2 Нет call M84 Нет Да Да Нет Да ??? Да call M84
Параметры
Эта команда может быть использована без каких-либо дополнительных параметров.1
X ось X
Y ось Y
Z ось Z
E Экструдер(ы)2
Пример
M18
M18 X E0

Выключает подачу питания на шаговые двигатели, после чего их можно перемещать "от руки"

Примечание

1Некоторые прошивки не поддерживают передачу параметров, но в Marlin и RepRapFirmware данная функция доступна. 2RepRapFirmware позволяет выборочно выключать шаговые двигатели. Например, M18 X E0:2 отключит двигатели X, экструдер 0 и экструдер 2.

M20: Список файлов на SD карте

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Нет Да
Параметры
Эта команда может быть использована без параметров
Snnn стиль вывода списка 1
Pnnn Папка для вывода списка 2
Пример
M20
M20 S2 P/gcodes/subdir

Этот код выводит все файлы в корневой директории или файлы g-кодов на SD карте через последовательный порт. По одному названию файла в строке.

ok
SQUARE.G
SQCOM.G
ZCARRI~2.GCO
CARRIA~1.GCO

В прошивке Marlin уже имеется список файлов. В стандартной конфигурации RepRapFirmware подражает этому стилю в режиме эмуляции:

Begin file list:
SQUARE.G
ZCARRI~2.GCO
End file list
ok

Если в RepRapFirmware не включена эмуляция совместимости, то типичный вывод выглядит так:

GCode files:
"Traffic cone.g","frog.gcode","calibration piece.g"

К сведению: в некоторых прошивках список файлов хранится в верхнем регистре, но если предварительно послать команду M23, они должны быть в нижнем регистре. Teacup и RepRapFirmware без проблем допускают использование обоих регистров. RepRapFirmware всегда возвращает длинные имена файлов в том регистре, в котором они были записаны.

Примечания

1Если в RepRapFirmware использовать параметр S2, то список файлов будет выводиться в формате JSON, как один массив, называющийся: "files" и содержащий каждое имя файла. Вложенные папки будут помечены звездочкой. Имя папки находится в переменной "dir". Пример:

M20 S2 P/gcodes
{"dir":"\/gcodes","files":["4-piece-1-2-3-4.gcode","Hinged_Box.gcode","Hollow_Dodecahedron_190.gcode","*Calibration pieces"]}

2Этот параметр поддерживатеся только RepRapFirmware и по умолчанию 0:/папак gcodes, в которой обычно хранятся файлы для печатаемых g-кодов.

M21: Инициализация SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Нет Да
Параметры
Pnnn Номер SD карты (Только для RepRapFirmware, по умолчанию 0)
Примеры
M21
M21 P1

Указанная SD карта будет проинициализирована. Если SD карта загружена при включении принтера, то это произойдет по умолчанию. SD карта должна быть проинициализирована для работы других функций SD карты.

M22: Освобождение SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Нет Да Нет ??? ??? Нет Да
Параметры
Pnnn Номер SD карты (Только для RepRapFirmware, по умолчанию 0)
Примеры
M22
M22 P1

Указанная SD карта будет освобождена. При будующих (случайных) попытках чтения происходит гарантированная ошибка. Полезно, но не обязательно перед извлечением SD карты.

M23: Выбор файла на SD карте

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Нет Да
Пример
M23 filename.gco

Файл, указанный как filename.gco (поддерживаются имена в формате 8.3) будет выбран для подготовки к печати. RepRapFirmware поддерживает длинные имена файлов наравне с форматом 8.3.

M24: Начало/продолжение печати с SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Да Да
Пример
M24

Принтер будет печатать из файла выбранного с помощью команды M23. Если печать была предварительно приостановлена командой M25, то печать продолжится с точки приостановки. Для печати сначала файла используйте команду M23 для сброса и заново начните печать командой M24.

Когда эта команда используется для продолжения печати, RepRapFirmware перед продолжением запустит макрос из файла resume.g.

M25: Пауза печати с SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Да Да
Пример
M25

Принтер приостановит печать из файла на текущей позиции. Для продоложения печати используйте M24. Не используйте этот g-код для приостановки печати в файл g-кода, взамен используйте M226.

Перед приостановкой печати RepRapFirmware запускает макрос из файла pause.g. Это позволяет переместить головку из области печати, сделать ретракт филамента и т.д.

M26: Установить позици в файле на SD карте

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да aborts Да Нет ??? ??? Нет Да
Параметры
Snnn Позиция в файле в байтах
Пример
M26

Устанавливет позицию в файле на карте SD в байтах (M26 S12345).

M27: Отчет о статусе печати с SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Да Да Нет ??? ??? Нет Да
Пример
M27

Отчет о статусе печати с SD карты.


Marlin и последние версии RepRapFirmware возвращают количество обработанных байт, в формате который может быть отображен в Pronterface:

SD printing byte 2134/235422

Если ни один файл не печатается, выдается сообщение:

Not SD printing.

M28: Начать запись на SD карту

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Да Да Нет ??? ??? Нет Да
Пример
M28 filename.gco

На SD карте создается файл, обозначенный как filename.gco (если файл существует, то он перезаписывается) и все последующие команды на принтер записываются в этот файл.

M29: Остановить запись на SD карту

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Нет Да Нет ??? ??? Нет Да
Пример
M29 filename.gco

Файл, открытый командой M28 закрывается и все последующие команды исполняются принтером в нормальном режиме.

M30: Удалить файл с SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Да Да Нет ??? Да Нет Да

Пример: M30 filename.gco
filename.gco будет удален.

M30 в grbl

M30 завершит программу. Нажатие кнопки начала цикла запустит программу с начала файла.

M31: Выводит время работы с последнего M109 или запуска печати с SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да
Пример
M31

Вывод будет выглядеть так:

 echo:54 min, 38 sec

M32: Выбрать файл и начать печать с SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Да Да Нет ??? ??? Нет Нет
Пример
M32 filename.gco

Используется для печати с SD карты и работает так же как M23 и M24.

Должно быть доступно в marlin(14/6/2014)

M33: Получить длинное имя файла или папки с SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Нет

Получить длинное имя файла или папки с SD карты из пути, заданного в DOS-формате. Объявлено в прошивке Marlin 1.1.0 в сентябре 2015 г.

M33: Остановить печать, закрыть файл и сохранить restart.gcode

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? Да

Останавливает печать с SD карты и сохраняет текущую позицию в restart.gcode для перезапуска принтера в дальнейшем.

M34: Указать порядок сортировки файлов на SD карте

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Нет

Включает и отключает сортировку файлов на SD карте и/или устанавливает порядок сортировки в папке. Предложено в прошивке Marlin в мае 2015 г.

M35: Скачивает прошивку NEXTION с SD карты

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? Да

M36: Получить информацию о файле

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Нет ??? Нет Нет
Пример
M36 filename.gco

Возвращает информацию о выбранном файле на SD карте в формате JSON. Пример посылаемых данных:

{"err":0,"size":457574,"height":4.00,"layerHeight":0.25,"filament":[6556.3],"generatedBy":"Slic3r 1.1.7 on 2014-11-09 at 17:11:32"}

Поле "err" равно нулю, если файл успешно прочитан и имеет ненулевое значение, если файл не найден или происходит ошибка чтения. Если файл успешно прочитан, то всегда будет присутствовать поле "size". Присутствие или отсутствие остальных полей зависити от различных данных, которые могут быть найдены в выбранном файле. Поле "filament" представляет собой массив длин прутка, требуемого с каждой катушки. Размер выдается в байтах, все остальные величины - в мм. Поля могут быть отсортированы, так же могут быть представлены дополнительные поля.

Если имя файла не указано и в текущее время происходит печать файла с SD карты, то будет возвращена информация об этом файле включая дополнительное поле "fileName". Это свойство используется в web-интерфейсе и интерфейсе PanelDue таким образом: если во время подключения идет печать файла, то будет показано его имя и другая информация.

M37: Режим симуляции

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет

Используется для переключения между режимом печати и режимом симуляции. В режиме симуляции электроника может рассчитать время печати в зависимости от заданных в конфигурации максимальных скоростей, ускорений и т.д.

M37 S1 включает режим симуляции. Все G и M будут неактивны, но будет рассчитываться время выполнения.

M37 S0 отменяет режим симуляции.

M37 без параметра S выдает рассчитанное время печати от команды M37 S1, до текущей точки(если режим симуляции активен) или до точки, когда симуляция закончилась (если режим симуляции более не активен).

M38 Вычислить контрольную сумму SHA1 для указанного файла

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет

Используется для вычисления контрольной суммы указанного файла на SD карте. Примеры:

M37 gcodes/myfile.g

Cannot find file

M37 www/reprap.htm

91199139dbfadac15a18cfb962dfd4853db83999

Возвращает шестнадцетиричную строку, содержащую контрольную сумму SHA1 указанного файла. Если файл не найден, то возвращается строка "Cannot find file".

M40: Извлечь

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Если ваш принтер умеет снимать напечатанные детали со стола, то эта команда запустит цикл снятия. Как правило он включает в себя охлаждение стола и последовательность движений, которые удаляют напечатанные части с него. Положение по осям X, Y и Z в конце цикла не определено, но как правило может быть получено с помощью команды M114.

Смотрите так-же M240 и M241 ниже.

M41: Зациклить

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Пример: M41

Если ваш принтер печатает файл из памяти, например с SD карты (то есть файл не передается с подключенного компьютера), то эта команда позволяет вернуться на начало файла и запусть печать сначала. Например, если ваш принтер позволяет автоматически снимать детали со стола, то вы можете зациклить печать и запускать ее снова и снова. Будьте осторожны - подумайте о способе остановке цикла:

  1. При нажатии кнопки сброса,
  2. При окончании пластика(если ваш принтер умеет определять это), и
  3. При какой нибудь ошибке (например ошибке нагрева).

M42: Управление пинами ввода/вывода

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Нет Да Нет Нет ??? Нет Да
Parameters
Pnnn номер пина
Snnn назначение пина
Пример
M42 P7 S255

M42 переключает основное назначение пинов. Используйте M42 Px Sy для установки значения y на пин x, если не указать Px то будет использован LEDPIN.

In Teacup, general purpose devices are handled like a heater, see M104.

In RepRapFirmware, the S field may be in the range 0..1 or 0..255. The pin reference is an internal firmware reference named "digital pin", see Duet pinout. It maps on different connector pins depending the hardware. On Duet 0.6 and 0.8.5 hardware using pre-1.16 firmware, the supported pin numbers and their names on the expansion connector are:

Duet M42 P value to Expansion Port Pin Mapping
P Name Expansion Port Pin
16 TXD1 11
17 RXD1 12
18 TXD0 13
19 RXD0 14
20 TWD1 35
21 TWCK1 36
23 PA14 10
36 PC4 18
52 AD14 41
67 PB16 32

In firmware 1.16, the pin numbering has changed.

Duet 0.6 and 0.8.5 v1.16+ M42 P value to Expansion Port Pin Mapping
P Name Expansion Port Pin
60 PA10/RXD0 14
61 PA11/TXD0 13
62 PA12/RXD1 12
63 PA13/TXD1 11
64 PA14/RTS1 10
65 PB12/TWD1 35
66 PB13/TWCK1 36
67 PB16/DAC1* 32
68 PB21/AD14 41
69 PC4 18
  • Also used as CS signal on external SD card socket
Duet WiFi v1.16+ M42 P value to Expansion Port Pin Mapping
P Signal Name Expansion Connector Label
60 CS5 CS5
61 CS6 E3_STOP
62 CS7 E4_STOP
63 CS8 E5_STOP

See Using servos and controlling unused I/O pins for all pin definitions.

Pre-1.16 example:

M42 P20 S1 ;set the connector pin 35 to high.

On RADDS hardware running RepRapFirmware-dc42, the supported Arduino Due pin numbers and their names are:

5 TIOA6, 6 PWML7, 39 PWMH2, 58 AD3, 59 AD2, 66 DAC0, 67 DAC1, 68 CANRX0, 69 CANTX0, 70 SDA1, 71 SCL1, 72 RX LED, 73 TX LED.

See also M583.

M43: Ждущий режим при окончании материала

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Пример: M43

Если ваш принтер обнаружит, окончание пластика, то он перейдет в режим ожидания. При этом оси X и Y (но не Z) будут обнулены, и принтер отключит все моторы и нагреватели за исключением горячего стола, температура которого будет поддерживаться. В этом режиме принтер будет отвечать на все G и M коды.

M43: Состояние и отладка пинов

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Нет
Использование
M43 En Pnnn Wn In
Параметры
En Включить/выключить фоновый мониторинг концевиков
Pnnn Пин для чтения или наблюдения. Если пропущено, то будут читаься/наблюдаться все пины
Wn логическая - наблюдать за пинами -отчет об изменениях- до сброса, нажатия или M108
In логическая - флаг ингнорирования защиты пина

M48: Погрешность воспроизводимости Z-пробы

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да
Параметры
Pnnn количество точек
Xnnn позиция по оси X
Ynnn позиция по оси Y
Vnnn значимость вывода
E объединение
Lnnn legs of travel

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

M70: Показать сообщение

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет see M117 Нет ??? see M117 Нет Да ??? see M117 see M117

Пример:

M70 P200 Сообщение

Дает команду принтеру вывести сообщение на его экране. Параметр P - это время отображения сообщения.

M72: Воспроизвести ноту или звук

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет see M300 Нет Нет see M300 Нет Да ??? Нет see M300

Пример: M72 P2

Дает команду принтеру воспроизвести предустановленный звук. Доступные иденитфикаторы звуков зависят от принтера. Параметр P - это идентификатор звука для воспроизведения.

M73: Установить процент печати

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет Да ??? Нет Нет

Пример: M73 P50

Указывает принтеру, что печать выполнена на указанное количество процентов. Принтер может показать это значение на встроенном дисплее. Если значение равно 0, то посылается уведомление о начале печати. Если значение равно 100, то посылается уведомление о конце печати.

M80: Включить блок питания ATX

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет automatic Да Да Да Нет Да Нет ??? ??? Нет Да
Пример
M80

Переводит блок питания ATX из спящего режима в рабочий режим. Не работает на электронике без спящего режима.

Примечание: Некоторые прошивки, например Teacup, могут включать/выключать питание автоматически, так что данная команда является излишней. Так же смотрите RAMPS wiring for ATX on/off

M81: Выключить блок питания ATX

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет automatic Да Да Да Нет Да Нет ??? ??? Да Да
Пример
M81

Выключает блок питания ATX. Противоположна команде M80.

For redeem, adding 'P' will quit the daemon (redeem). Adding parameter 'R' will restart the daemon.

M82: Установить экструдер в абсолютный режим

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Нет Да
Пример
M82

Позволяет экструдеру производить экструзию в абсолютных единицах.

В прошивке repetier установлено по умолчанию.

M83: Установить экструдер в относительный режим

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Нет Да
Пример
M83

Позволяет экструдеру производить экструзию в относительных единицах.

M84: Перейти в режим ожидания

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Да Да
Параметры
Эта команда может использоваться без дополнительных параметров.
Innn Флаги сброса1
Пример
M84

Устанавливает режим ожидания для всех осей и экструдера. В некоторых случаях удержание двигателей в режиме ожидания может вызывать раздражжающие шумы. В этом случае можно выключить удержание двигателей в режиме ожидания. Имейте ввиду, что отключение удержания может отрицательно сказаться на качестве печати и имеет смысл только по окончании печати.

В прошивках Marlin, Repetier и RepRapFirmware, M84 может так же использоваться для установки времени, после которого включается режим ожидания. Например, "M84 S10" переведет шаговые двигатели в режим ожидания после 10 секунд простоя. "M84 S0" отключит время простоя; шаговики будут оставаться под напряжением независимо от активности.

Примечание

1RepRapFirmware-dc42 и другие прошивки могут не поддерживать данный параметр.

M85: Установить таймер отключения по отсутствию актвиности

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Нет Нет Нет ??? ??? Нет Да

Пример: M85 S30

Установить таймер отключения по отсутствию активности с параметром S<секунд>. "M85 S0" выключает таймер отключения по отсутствию активности(по умолчанию)

M92: Установить количество шагов по осям на единицу

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Да Да Нет ??? ??? Да Да
Параметры
Xnnn Количество шагов на единицу для двигателя X
Ynnn Количество шагов на единицу для двигателя Y
Znnn Количество шагов на единицу для двигателя Z
Ennn Количество шагов на единицу для двигателя(ей) экструдера(ов)
Примеры
M92 X87.489 Y87.489 Z87.489
M92 E420:420

Позволяет устанавливать количество шагов на единицу (обычно мм) для двигаетелй. Это значение заменяется на значение из прошивки при включении питания, если не записать его в ППЗУ, если данная функция доступна (M500 для Marlin) или из конфигурационного файла (config.g в RepRapFirmware). Часто используется при калибровке

RepRapFirmware покажет текущее значение шагов на мм, если получит команду M92 без дополнительных параметров.

M93: Передать количество шагов на единицу

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Нет ??? Нет Use M92 Нет ??? ??? Нет Нет

M98: Выполнить макрос/подпрограмму

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Нет ??? Нет Нет
Параметры
Pnnn Имя файла макроса
Пример
M98 Pmymacro.g

Запускает макрос из файла mymacro.g. В стандарте g-кода для ЧПУ обычно параметр P ссылается на номер строки в тойже программе (P2000 говорит, что надо запустить макрос со строки O2000). Для принтеров, которые почти всегда имеют на борту какую нибудь память проще сослаться на имя файла g-кода, который может быть выполнен командой G98. Этот файл g-кода не должен заканчиваться на M99 (вернуться) так как возврат будет автоматически выполнен при достижении конца файла. Вызываемый макрос не должен содержать вложений или рекурсию, то есть не должен вызываться макрос из макроса, хотя RepRapFirmware поддерживает данную функцию.

RepRapFirmware также позволяет указывать имя файла, содержащее путь к подпапке. Для относительных путей по умолчанию используется директория /sys, но некотрые модификации так же проверяют директорию /macros. Абсолютные пути к файлам отлично поддерживаются RepRapFirmware.

M99: Вернуться из макроса/подпрограммы

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Нет ??? Нет Нет
Пример
M99

Возвращается к оснвной программе после вызов M98.

RepRapFirmware закрывает активный файл макроса. Если выполняется вложенный макрос RepRapFirmware переходит на уровень стека выше.

M98: Получить гестерезис по осям в мм

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Устаревшая - переписана в текущем стандарте g-кодов кодом M98 выше

Пример: M98

Показывает текущую величину гесетерезиса в мм для всех осей.

Предложена для Marlin

M99: Установить люфт по осям в мм

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Устаревшая - заменена в текущем стандарте g-кодов командой M99 выше

Пример: M99 X<mm> Y<mm> Z<mm> E<mm>

Позволяет компенсировать люфт для осей. Шпули, шестеренки и ремни люфтят при смене направления. Поэтому требуется сделать несколько шагов перед движением в противоположном направлении. Вы можете измерить насколько велик люфт в мм и установить его величину данной командой. Тогда при каждой смене направления движения по оси эти дополнительные мм будут компенсироваться для устранения люфта.

Предложено для Marlin

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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 firmware: Turn extruder on (forward/filament in).

in other firmwares: Deprecated. Regarding filament retraction, see M227, M228, M229.

M102: Turn extruder 1 on (Reverse)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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

In other firmwares: Deprecated.

M103: Turn all extruders off, Extruder Retraction

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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 other firmwares: Deprecated. Regarding extruder retraction, see M227, M228, M229.

M104: Set Extruder Temperature

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да Да ??? Да Да
Parameters
Snnn Target temperature
Example
M104 S190

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). Duet-dc42 and other firmware also supports the optional T parameter (as generated by slic3r) to specify which tool the command applies to. See also M109.

This is deprecated because temperatures should be set using the G10 and T commands (q.v.).

Deprecation is subject to discussion. --Traumflug 11:33, 19 July 2012 (UTC)

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.

M105: Get Extruder Temperature

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Нет Да ??? Да Да
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 and the build base in degrees Celsius. The temperatures are returned to the host computer. For example, the line sent to the host in response to this command looks like:

ok T:201 B:117

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

In Repetier you can add X0 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да ??? ??? Да Да
Parameters
Pnnn Fan number (optional, defaults to 0)2
Snnn Fan speed (0 to 255; RepRapFirmware also accepts 0.0 to 1.0))
Extra Parameters
Innn Invert signal, or disable fan1
Fnnn Set fan PWM frequency, in Hz1
Lnnn Set minimum fan speed (0 to 255 or 0.0 to 1.0)1
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
Rnnn Restore fan speed to the value it has when the print was paused1
Tnnn Set thermostatic mode trigger temperature1
Examples
M106 S127
M106 P1 I1 S871
M106 P1 T45 H1:21
M106 P2 B0.1 L0.051

The first example turns on the default cooling fan at half speed. The second one inverts the cooling fan signal of the second fan and sets its value to 1/3 of its maximum. The third one sets the second fan to a thermostatic fan for heaters 1 and 2 (e.g. the extruder heaters in a dual-nozzle machine) such that the fan will be on when either hot end is at or above 45C.

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

1These parameters are only available in RepRapFirmware.

2Marlin only supports fan 0, all values above 0 will be interpreted as 0

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

Additionally to the above, Teacup Firmware uses M106 to control general devices. 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Нет Да Да Да Да Да Да ??? ??? Да Да

Deprecated in Teacup firmware and in RepRapFirmware. Use M106 S0 instead.

M108: Cancel Heating (Marlin)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да

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.

M108: Set Extruder Speed (BFB)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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

M109: Set Extruder Temperature and Wait

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да not needed Да Да Да Да Да Да Да ??? Да Да
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)
Example
M109 S215
M109 in Teacup

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

M109 in Marlin, Sprinter (ATmega port), RepRapFirmware

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 //sets extruder temperature to 185 and waits 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да not needed Нет Да Да Да Да Нет ??? ??? Да Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Debug Нет Да Да Нет Да Нет ??? ??? Да Да
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.

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: Emergency Stop

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Нет Да Да Да Да Нет ??? ??? Да Да
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.

M113: Set Extruder PWM

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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.

M114: Get Current Position

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Нет Да ??? Да Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Нет Да Нет Нет ??? Да Да
Parameters
This command can be used without any additional parameters.
Pnnn Electronics type1
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

M116: Wait

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Нет Нет Да Нет Да Нет Да ??? Да Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Нет Нет Нет Нет Нет Нет Нет 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да Да Да Нет Нет ??? Да Да
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.

M118: Negotiate Features

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Да Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Да Нет ??? ??? Нет Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Да Нет ??? ??? Нет Нет
Example
M121

Recover the last state pushed onto the stack.

M120: Enable endstop detection

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да

M121: Disable endstop detection

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да

M122: Diagnose

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет
Example
M122

Sending an M122 causes the RepRap to transmit diagnostic information, for eaxmple 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.

M123: Tachometer value

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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

M124: Immediate motor stop

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Immediately stops all motors.

M126: Open Valve

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Нет Нет Да Нет Нет Нет Нет Да ??? Нет Да

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Нет Нет Да Нет Нет Нет Нет Да ??? Нет Да

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да

Example: M128 S255

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

M129: Extruder pressure off

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет see M301 Нет see M301 Нет Нет ??? ??? see M301 see M301
Parameters
Pnnn heater number
Snnn proportional (Kp)
Example
M130 P0 S8.0 ; Sets heater 0 P factor to 8.0

Teacup can control multiple heaters with independent PID controls. For the default shown at https://github.com/Traumflug/Teacup_Firmware/blob/master/config.default.h, heater 0 is the extruder (P0), and heater 1 is the bed (P1).

Teacup's PID proportional units are in pwm/255 counts per quarter C, so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 4. In the above example, S=8 represents a Kp=8*4=32 counts/C.

M131: Set PID I value

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет see M301 Нет see M301 Нет Нет ??? ??? see M301 see M301
Parameters
Pnnn heater number
Snnn integral (Ki)
Example
M131 P1 S0.5 ; Sets heater 1 I factor to 0.5

Teacup's PID integral units are in pwm/255 counts per (quarter C*quarter second), so to convert from counts/qCqs, you would divide by 16. Conversely, to convert from count/qCqs to count/Cs, multiply by 16. In the above example, S=0.5 represents a Ki=0.5*16=8 counts/Cs.

M132: Set PID D value

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет see M301 Нет See M301 see M301 Нет Да ??? see M301 see M301
Parameters
Pnnn heater number
Snnn derivative (Kd)
Example
M132 P0 S24 ; Sets heater 0 D factor to 24.0

Teacup's PID derivative units are in pwm/255 counts per (quarter degree per 2 seconds), so to convert from counts/C, you would divide by 4. Conversely, to convert from count/qC to count/C, multiply by 8. In the above example, S=24 represents a Kd=24*8=194 counts/(C/s).

M132 in MakerBot

Example: M132 X Y Z A B

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

M133: Set PID I limit value

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет see M301 Нет Нет Нет Нет Да ??? see M301 see M301
Parameters
Pnnn heater number
Snnn integral limit (Ki)
Example
M133 P1 S264 ; Sets heater 1 I limit value to 264

Teacup's PID integral limit units are in quarter-C*quarter-seconds, so to convert from C-s, you would multiply by 16. Conversely, to convert from qC*qs to C*s, divide by 16. In the above example, S=264 represents an integral limit of 16.5 C*s.

M133 in MakerBot

Example: M133 T0 P500

Instruct the machine to wait for the toolhead to reach its target temperature. T is the extruder to wait for. P if present, sets the time limit.

M134: Write PID values to EEPROM

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Нет Нет Нет Нет: See M504 see M500 Нет Да ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Да ??? Нет Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Debug Нет Нет Нет Нет see M301 Нет ??? ??? Нет Нет

Example: M136 P1 # print heater 0 PID parameters to host

M140: Set Bed Temperature (Fast)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Да Да Да Да Да Да Да ??? Да Да
Parameters
Snnn Target temperature
Hnnn Heater number1
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). There is an optional R field that sets the bed standby temperature: M140 S65 R40.

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

M140 S-273.15

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)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет uses M104 Нет Нет Нет Нет Да Да ??? ??? Нет Нет
Parameters
Snnn Target temperature
Hnnn Heater number1
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

1This parameter is only available in RepRapFirmware.

M142: Holding Pressure

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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.

M143: Maximum hot-end temperature

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет

Example: M143 S275

Set the maximum temperature of the hot-end to 275°C.

Default value is 300°C prior to RepRapFirmware version 1.13 and 262°C from 1.13 onwards.

When temperature of the hot-end exceeds this value, take countermeasures, for instance an emergency stop. This is to prevent hot-end damage.

M144: Bed Standby

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет
Example
M144

Switch the bed to its standby temperature. M140 turns it back to its active temperature; no need for any arguments for that use of M140.

M146: Set Chamber Humidity

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет
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 display color

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да
Parameters
Rnnn red
Unnn green
Bnnn blue
Example
M150 R255 U128 B192

Set BlinkM Color via I2C. Range for values: 0-255

M155: Automatically send temperatures

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да: 1.1.0 Да Нет Нет Нет ??? ??? Нет Да
Parameters
Snnn enable sending temperatures = 1, disable = 0
Example
M155 S1

Hosts normally monitor printer temperatures by sending a M105 every x seconds. This not only adds traffic, but also only works while printer is not blocked by waiting commands. So frequency more depends on frequency you can send new commands and creates extra traffic. As a solution, firmware can be told to automatically send temperatures every second. This function is disabled by default for best compatibility with existing hosts. To indicate the availability of this function, M115 should add a extra line

Cap:AUTOREPORT_TEMP:1

so hosts know about the presence of the function.

M160: Number of mixed materials

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да: RC7 Да: 0.92 Нет Use M567 Нет ??? ??? Нет Нет
Parameters
Snnn extruder number
Pnnn weight

Set weight for this mixing extruder drive.

M164: Store weights

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да: RC7 Да: 0.92 Нет Нет Нет ??? ??? Нет Нет
Parameters
Snnn virtual extruder number
Pnnn store to eeprom (P0 = no, P1 = yes)

Store weights as virtual extruder S.

M165: Set multiple mix weights

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да: RC7 Нет: Нет Нет Нет ??? ??? Нет Нет
Parameters ABCDHI
A A[factor] Mix factor for extruder stepper 1
B B[factor] Mix factor for extruder stepper 2
C C[factor] Mix factor for extruder stepper 3
D D[factor] Mix factor for extruder stepper 4
H H[factor] Mix factor for extruder stepper 5
I 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет: See M116 Да Да Да Да Да Да ??? ??? Да Да
Parameters
Snnn minimum target temperature, waits until heating
Rnnn accurate target temperature, waits until heating and cooling (Marlin)
Example
M190 S60

This will wait until the bed temperature reaches 60 degrees, printing out the temperature of the hot end and the bed every second.

M191: Wait for chamber temperature to reach target temp

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет see M301 C1 Да ??? ??? Нет Нет

Example: M191 P60

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

M200: Set filament diameter

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да Да see M404 Да ??? ??? Нет Да

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Нет Да Нет ??? ??? Да Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет ??? Да Да Нет Нет Нет ??? ??? ??? Да

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

M203: Set maximum feedrate

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет ??? Да Да Да Да Нет ??? ??? ??? Да
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 Repetier

Set temperture monitor to Sx.

M204: Set default acceleration

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Да Нет Нет ??? ??? ??? Да

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" set the acceleration for printing movements to 800mm/s^2, for travels to 3000mm/s^2 and for retracts to 9000mm/s^2.

M204 Repetier

M204 X[Kp] Y[Ki] Z[Kd] -

Set PID parameter. Values are 100*real value.

M205: Advanced settings

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Да see M566 Нет ??? ??? ??? Да

Sprinter and Marlin:

minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk

Sprinter / Marlin Example:

M205 X30 Z5 ; Set X/Y Jerk to 30mms, Z jerk to 5mms


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 Repetier

Output EEPROM settings.

M206: Offset axes

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Нет Да Да Нет ??? ??? Да Да
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.

M206 in Repetier: Set eeprom value

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет

M206 T[type] P[pos] [Sint(long] [Xfloat] Set eeprom value

Example: M206 T3 P39 X19.9

Set Jerk to 19.9

M207: Calibrate z axis by detecting z max length

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет ??? Нет Нет Нет ??? ??? Нет Нет

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 retract length

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Да Да Нет ??? ??? Нет Да
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

Sets the retract length used by the G10 and G11 commands, stays in mm regardless of M200 setting

M208: Set axis max travel

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет
Parameters
Snnn Whether to set the axis minimum1
Xnnn X axis limit
Ynnn Y axis limit
Znnn Z axis limit
Example
M208 X250 Y210 Z180

The values specified set the software limits for axis travel in the positive direction.

RepRapPro's version of Marlin uses M208 this way. Send M503 to see the current values. On Marlin, the value can be saved to EEPROM using the M500 command.

Notes

1With RepRapFirmware on a Cartesian printer, you can also use this command to specify software limits for axis travel in the negative direction, by adding parameter S1. The axis limits you set are also the positions assumed when an endstop is triggered.

M208 X200 Y200 Z90; set axis maxima
M208 X-5 Y0 Z0 S1 ; set axis minimum

M208: Set unretract length

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Да See M207 Нет ??? ??? Нет Да
Parameters
Snnn positive length surplus to the M207 Snnn, in mm
Fnnn feedrate, in mm/sec

Sets recover=unretract length.

M209: Enable automatic retract

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да Нет Нет Нет Нет ??? Нет Да

Example: M209 S1

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

M210: Set homing feedrates

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Example: M210 X1000 Y1500

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

M211: Disable/Enable software endstops

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Use M564 Нет ??? ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да* Нет Нет Use G31 Нет ??? ??? Нет Да

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.

M218: Set Hotend Offset

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Use G10 Нет ??? ??? Нет Да

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

Example: M218 T1 X50 Y0.5

M220: Set speed factor override percentage

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Да Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Да Да Да Да Да Да Нет ??? ??? Да Да
Parameters
Snnn Extrude factor override percentage (0..100 or higher), default 100%
Dnnn Extruder drive number (RepRapFirmware only), default 0
Example
M221 S70
M221 S95 D1

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

M220: Turn off AUX V1.0.5

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

M221: Turn on AUX V1.0.5

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

M222: Set speed of fast XY moves

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

M223: Set speed of fast Z moves

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

M224: Enable extruder during fast moves

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

M225: Disable on extruder during fast moves

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

M226: Gcode Initiated Pause

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Да ??? ??? Нет Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да Нет see M577 Нет ??? ??? Нет Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Example: M228

See also M227.

M229: Enable Automatic Reverse and Prime

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Example: M229 P1.0 S1.0

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

M230: Disable / Enable Wait for Temperature Change

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Example: M230 S1

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

M231: Set OPS parameter

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет

M231 S[OPS_MODE] X[Min_Distance] Y[Retract] Z[Backslash] F[ReatrctMove]

M232: Read and reset max. advance values

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет

M240: Trigger camera

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да

Example: M240

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

M240: Start conveyor belt motor / Echo off

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Debug: Echo off Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Debug: Echo on Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Example: M241

Echoing may be controlled in some firmwares with M111

M245: Start cooler

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Example: M245

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

M246: Stop cooler

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Нет Нет

Example: M246

M250: Set LCD contrast

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет Нет ??? Нет Да

Example: M250 C20

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

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет

M251 S0 - Reset, S1 - Print, S2 - Store to Z length (also EEPROM if enabled)

(This is a Repetier-Firmware only feature)

M260: i2c Send Data

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да: 1.1.0 Нет Нет Нет Нет Нет ??? Нет Да

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.

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

M261: i2c Request Data

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да: 1.1.0 Нет Нет Нет Нет Нет ??? Нет Да

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

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Use M340 Нет 1.16 and later Да ??? ??? Да Да

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.

M300: Play beep sound

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да Нет Да Да Да ??? Нет Да
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.

M301: Set PID parameters

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет: See M13[0-3]) Да Да Да Да Да Нет ??? ??? Да Да
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
M301 H1 P1 I2 D3 T0.2 B20 W127 S0.8 ; RepRapFirmware (v1.09 onwards), Duet-dc42
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.

Marlin

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

RepRapFirmware (v1.09 onwards)

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да: 0.92 Нет Да1 Нет ??? ??? Нет Да
Parameters
Snnn Cold extrude minimum temperature
Pnnn Cold extrude allow state (RepRapFirmware)
Examples (RepRapFirmwre)
M302 ; Report current state
M302 P1 ; Allow cold extrusion
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да Да 1.15 and later Нет ??? ??? Да Да

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? see M301 Да Нет ??? ??? Нет Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет ??? Да Да Нет ??? ??? Нет Нет
Parameters
Pnnn Heater number
Tnnn Thermistor resistance at 25oC
Bnnn Beta value, or the reciprocal of the Steinhart-Hart thermistor model B coefficient
Cnnn Steinhart-Hart C coefficient (RepRapFirmware 1.17 and later), default 0
Rnnn Series resistor value
Lnnn ADC low offset
Hnnn ADC high offset
Xnnn Heater ADC channel, or thermocouple or PT100 adapter channel, defaults to the same value as the P parameter
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.

RepRapFirmware also supports ADC gain and offset correction and a thermistor selection facility. 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. Thermocouple channels are numbered from 100 and PT100 channels from 200.

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет ??? Да Нет Нет ??? ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет 1.15 and later Нет ??? ??? Нет Нет
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
Two additional parameters help control the heating process
Bn selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for the bed heater.
Snnn maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.
Examples
M307 H0 ; report the process parameters for heater 0
M307 H1 A346.2 C140 D5.3 B0 S0.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 (including using different values for the heating or cooling phase and the steady state phase), to better detect heater faults, and 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.

M320: Activate autolevel (Repetier)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет
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)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет
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)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет
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)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? Нет Нет

(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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да Нет Да Нет ??? ??? Да Да

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? Нет Да

Example: M351

M355: Turn case lights on/off

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use M106 Нет Нет Да: 0.92.2 Нет Нет Нет ??? ??? Нет Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да: 0.92.2 Нет Нет Нет ??? ??? Нет Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Частично Нет Да Нет Нет ??? ??? ??? Частично

M360: Move to Theta 0 degree position

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Экспериментально Нет Да Нет Нет ??? ??? Нет Экспериментально

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Экспериментально Нет Да Нет Нет ??? ??? Нет Экспериментально

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Экспериментально Нет Да Нет Нет ??? ??? Нет Экспериментально

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

M363: Move to Psi 90 degree position

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Экспериментально Нет Да Нет Нет ??? ??? Нет Экспериментально

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

M364: Move to Psi + Theta 90 degree position

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Экспериментально Нет Да Нет Нет ??? ??? Нет Экспериментально

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Экспериментально Нет Да Нет Нет ??? ??? Нет Экспериментально

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

M366: SCARA convert trim

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Нет Нет ??? ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Нет Нет ??? ??? Нет Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Нет Нет ??? ??? ??? Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Нет Нет ??? ??? ??? Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Нет Нет ??? ??? ??? Нет

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

M374: Save calibration grid

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Нет Нет ??? ??? ??? Нет

Saves the calibration grid. (Smoothieware)

Usage
M374
M374 <file extension> Z

Without parameters safes the grid into the default grid file that gets loaded at boot 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

M375: Display matrix / Load Matrix

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Нет Нет ??? ??? ??? Нет

Display the bed level calibration matrix (Marlin) Load Grid matrix file (Smoothieware)

Usage
M375
M375 <file extension>

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.

M380: Activate solenoid

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? Нет Нет Нет ??? ??? ??? Да

Example: M380

Activates solenoid on active extruder.

M381: Disable all solenoids

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? Нет Нет Нет ??? ??? ??? Да

Example: M381

M400: Wait for current moves to finish

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет use G4 Да Да Да Да Да Да ??? ??? ??? Да
Example
M400

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

M401: Lower z-probe

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? Нет Нет Нет ??? ??? ??? Да

Example: M401

Lower z-probe if present.

M402: Raise z-probe

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? Нет Нет Нет ??? ??? ??? Да

Example: M402

Raise z-probe if present.

M404: Filament width and nozzle diameter

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Да Нет ??? ??? ??? Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? ??? Да

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? ??? Да

Example: M406

Turn off Filament Sensor extrusion control.

M407: Display filament diameter

{{firmware Support | fived=style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|Нет | teacup=style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|Нет | sprinter=style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|Нет | marlin=style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|Да | repetier=style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|Нет | smoothie=style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|Нет | bfb=style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|Нет | machinekit=style="background:#F99;vertical-align:middle;text-align:center;" class="table-no"|Нет | reprapfirmware=style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|Да | mk4duo={{yes} }}

Example
M407

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

M408: Report JSON-style response

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
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, A=paused, D=pausing, R=resuming, B=busy (running a macro)
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=fault
pos:     the X, Y and Z positions of the current tool (if a tool is selected), or 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)
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 cooling fan RPM
homed:   the homed status of the X, Y and Z axes (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
geometry: one of "cartesian", "delta", "corexy, "corexz" etc.

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.

M420: Set RGB Colors as PWM (MachineKit)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Да ??? ??? ??? Нет

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, is also: M420 - Enable/Disable Mesh Leveling (with current values) S1=enable S0=disable

M420: Enable/Disable Mesh Leveling (Marlin)

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? ??? Да

Example: M420 S1

Enable/Disable Mesh Leveling (with current stored mesh). S1=enable S0=disable

M421: Set a Mesh Bed Leveling Z coordinate

M421 - Set a single Z coordinate in the Mesh Leveling grid. X<index> Y<index> Z<offset in mm>

M450: Report Printer Mode

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? ??? Нет

Usage: M450

Example: M450 Output: 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? ??? Нет
Usage
M451
Example
M451
Output
PrinterMode:FFF

Switches to FFF mode for filament printing.

M452: Select Laser Printer Mode

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? ??? Нет
Usage
M452
Example
M452
Output
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? ??? Нет
Usage
M453
Example
M453
Output
PrinterMode:CNC

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

M460: Define temperature range for thermistor controlled fan

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да Нет Нет Нет ??? ??? ??? Нет
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.

M500: Store parameters in EEPROM

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да ??? Да Нет ??? ??? ??? Да
Example
M500

Save current parameters to EEPROM.

In Redeem any parameters set through G/M-codes which is different than what is read from the config files, are stored back to the local config. For instance setting stepper current and microstepping through M906 and M907 followed by M500 will update /etc/redeem/local.cfg.

M501: Read parameters from EEPROM

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да ??? Да Нет ??? ??? ??? Да
Parameters
Snnn Enable auto-save (only RepRapFirmware)
Example
M501

Set the active parameters to those stored in the EEPROM. This is useful to revert parameters after experimenting with them.

RepRapFirmware allows "S1" to be passed, which forces parameters to be automatically saved to EEPROM when they are changed.

M502: Revert to the default "factory settings."

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да Да ??? Да Нет ??? ??? ??? Да
Example
M502

This command resets all tunable parameters to their default values, as set in the firmware. This doesn't reset any parameters stored in the EEPROM, so it must be followed with M500 if you want to do that.

M503: Print settings

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Да Да ??? ??? Да Нет ??? ??? ??? Да
Example
M503

This command asks the firmware to reply with the current print settings stored in EEPROM. The reply output includes the G-Code commands to produce each setting. For example, the Steps Per Unit values are displayed as an M92 command.

RepRapFirmware outputs the content of the configuration file, but note that it may be truncated if it is too long.

M530: Enable printing mode

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да ??? Нет Нет ??? ??? ??? Да
Example
M530 S1 L270

This command tells the firmware that a print has started (S1) or ended (S0). The L parameter sets the number of layers. L0 denotes unknown layer count. This enables the firmware to switch into a special print display mode to show print progress. Firmware should indicate the presence of this feature by responding to M115 with an additional line:

Cap:PROGRESS:1

M531: Set print name

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да ??? Нет Нет ??? ??? ??? Да
Example
M531 Demo Model

Sets the name of the currently printed object. Should follow M530 S1 for correct display.

M532: Set print progress

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Да ??? Нет Нет ??? ??? ??? Да
Example
M532 X23.7 L56

Sets the print progress (X = 0..100) and currently printed layer (L). Should be send every 0.1% progress change on every layer change.

M540: Enable/Disable "Stop SD Print on Endstop Hit"

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? ??? Да
Parameters
Snnn state, S1=enable, S0=disable
Example
M540 S1

M540: Set MAC address

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn The MAC address
Examples
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED
M540 PDE:AD:BE:EF:CA:FE

Sets the MAC address of the RepRap. This should be done before any other network commands. The MAC address is six one-byte hexadecimal numbers separated by colons. The 0x prefix is optional in later firmware revisions.

All devices running on the same network shall all have different MAC addresses. For your printers, changing the last digit is sufficient.

M550: Set Name

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Machine name
Example
M550 PGodzilla

Sets the name of the RepRap to (in this case) Godzilla. The name can be any string of printable characters except ';', which still means start comment.

M551: Set Password

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Password
Example
M551 Pmy-very-secret-word

On machines that need a password to activate them, set that password. The code 'P' is not part of the password. Note that as this is sent in clear it does not (nor is it intended to) offer a very high level of security. But on machines that are (say) on a network, it prevents idle messing about by the unauthorised. The password can contain any printable characters except ';', which still means start comment.

Note for RepRapFirmware: If the specified password differs from the default one (i.e. reprap), the user will be asked to enter it when a connection is established via HTTP or Telnet. For FTP, the password must always be passed explicitly.

M552: Set IP address

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn IP address
Snnn Enable networking (optional)
Rnnn HTTP port (default 80)
Example
M552 P192.168.1.14

Sets the IP address of the RepRap machine to (in this case) 192.168.1.14. A restart may be required before the new IP address is used. If no 'P' field is specified, this echoes the existing IP address configured. If S0 is added thus: M552 S0 P192.168.1.14 networking is disabled. If you set the address M552 P0.0.0.0 the RepRap machine will try to obtain its IP address from the network's DHCP server, whereupon it will appear on the network with an address something like http://godzilla.home, where godzilla is the name set by the M550 command (see above). The precise URL incorporating that name will depend on the conventions of your network.

Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.

M553: Set Netmask

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Net mask
Example
M553 P255.255.255.0

Sets the network mask of the RepRap machine to (in this case) 255.255.255.0. A restart may be required before the new network mask is used. If no 'P' field is specified, this echoes the existing network mask configured.

Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.

M554: Set Gateway

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Gateway
Example
M554 P192.168.1.1

Sets the Gateway IP address of the RepRap machine to (in this case) 192.168.1.1. A restart may be required before the new gateway IP address is used. If no 'P' field is specified, this echoes the existing Gateway IP address configured.

Recent RepRapFirmware versions allow the IP configuration to be changed without a restart.

M555: Set compatibility

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Emulation type
Example
M555 P1

For firmware that can do it, the firmware is set to a mode where its input and (especially) output behaves exactly like other established firmware. The value of the 'P' argument is:

P value Firmware
0 Native (i.e. whatever the firmware actually is)
1 RepRap_Firmware
2 Marlin
3 Teacup
4 Sprinter
5 Repetier

M556: Axis compensation

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Snnn Height of the measured distances
Xnnn Deviation in X direction
Ynnn Deviation in Y direction
Znnn Deviation in Z direction
Example
M556 S100 X0.7 Y-0.2 Z0.6
Файл:CalibrationAngle.png
Image denoting how to determine the S parameter for Gcode M556

Though with care and adjustment a RepRap can be set up with its axes at right-angles to each other within the accuracy of the machine, who wants to bother with care and adjustment when the problem can be solved by software? This tells software the tangents of the angles between the axes of the machine obtained by printing then measuring a test part. The S parameter (100 here) is the length of a triangle along each axis in mm. The X, Y and Z figures are the number of millimeters of the short side of the triangle that represents how out of true a pair of axes is. The X figure is the error between X and Y, the Y figure is the error between Y and Z, and the Z figure is the error between X and Z. Positive values indicate that the angle between the axis pair is obtuse, negative acute.

M557: Set Z probe point or define probing grid

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Да Нет ??? ??? ??? Нет
Parameters to define G32 probe points (Cartesian/CoreXY printer only)
Pnnn Probe point number
Xnnn X coordinate
Ynnn Y coordinate
Example
M557 P1 X30 Y40.5
Parameters to define G29 probe grid (all values in mm)
Xaaa:bbb Minimum and maximum X coordinates to probe
Yaaa:bbb Minimum and maximum Y coordinates to probe
R Radius to probe
S Probing interval
Examples
M557 X0:200 Y0:220 S20
M557 R150 S15

Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal.

The first form defines the points for for G32 bed probing. The P value is the index of the point (indices start at 0) and the X and Y values are the position to move extruder 0 to to probe the bed. An implementation should allow a minimum of three points (P0, P1 and P2). This just records the point coordinates; it does not actually do the probing. See G32.

The second form defines the grid for G29 bed probing. For Cartesian printers, specify minimum and maximum X and Y values to probe and the probing interval. For Delta printers, specify the probing radius. There is a firmware-dependent maximum number of probe points supported, which may be as low as 100.

M558: Set Z probe type

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Z probe type
Xnnn Use probe for X axis
Ynnn Use probe for Y axis
Znnn Use probe for Z axis
Fnnn Feed rate (i.e. probing speed)1
Hnnn Dive height1
Innn Invert (I1) or do not invert (I0) the Z probe reading (RepRapFirmware 1.16 and later)
Tnnn Travel speed to probe points1
Snnn Extra parameter for experimentation (1)
Rnnn Extra parameter for experimentation (2)2
Example
M558 P0 X1 Y0 Z1

A Z probe may be a switch, an IR proximity sensor, or some other device. This selects which to use. P0 indicates that no Z probe is present. P1 gives an unmodulated IR probe, or any other probe type that emulates an unmodulated IR probe (probe output is an analog signal that rises with decreasing nozzle height above the bed). If there is a control signal to the probe, it is driven high when the probe type is P1. P2 specifies a modulated IR probe, where the modulation is commanded directly by the main board firmware using the control signal to the probe. P3 selects an alternative Z probe by driving the control signal to the probe low. P4 selects a switch for bed probing (on the Duet, this must be connected to the E0 endstop pins). P5 (from DC42 1.14) selects a switch (normally closed) for bed probing between In and Gnd pins of the Z-probe connector (Duet 0.8.5 and Duet WiFi).

The X, Y and Z parameters specify whether each axis uses the Z probe for homing or not. If the parameter is nonzero, the Z probe is used for homing that axis. if the parameter is zero, the endstop switch for that axis is used for homing instead. See also G31 and G32.

Recent versions of RepRapFirmware support an additional parameter H. This specifies the dive height (default 3mm) from which probing is done in response to a G30 command when the P parameter is present, or a G32 command.

Notes

1These parameters are only supported by recent RepRapFirmware versions and should be specified in mm/min.

2This parameter used to specify the Z probe channel in RepRapFirmware, but it has been superceded by the functionality of "M115 Px". With older firmware versions and a Duet 0.7/0.85, this parameter should be 1.

M559: Upload configuration file

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Example
M559

If the RepRap supports it, this uploads a file that is run on re-boot to configure the machine. This file usually is a special G Code file. After sending M559, the file should be sent, ending with an M29 (q.v.).

M560: Upload web page file

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Example
M560

For RepRaps that have web support and that can be driven by a web browser, this uploads the file that is the control page for the RepRap. After sending M560 the file (usually an HTML file) should be sent, terminated by the string

<!-- **EoF** -->

. Clearly that string cannot exist in the body of the file, but can be put on the end to facilitate this process. This should not be too serious a restriction...


M561: Set Identity Transform

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да Да Нет ??? ??? ??? Нет
Example
M561

This cancels any bed-plane fitting as the result of probing (or anything else) and returns the machine to moving in the user's coordinate system.

M562: Reset temperature fault

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Heater number
Example
M562 P2

Reset a temperature fault on heater/sensor 2. If the RepRap has switched off and locked a heater because it has detected a fault, this will reset the fault condition and allow you to use the heater again. Obviously to be used with caution. If the fault persists it will lock out again after you have issued this command. P0 is the bed; P1 the first extruder, and so on.

M563: Define or remove a tool

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Tool number
Dnnn Extruder drive(s)
Hnnn Heater(s)
Fnnn Fan(s) to map fan 0 to (RepRapFirmware 1.16 and later)
Xnnn Axis or axes to map X movement to (RepRapFirmware 1.16 and later)
Example
M563 P0 D0:2:3 H1:3              ; create a tool using extruder drives 0, 2 and 3 and heaters 1 and 3
M563 P1 D1 H2 X3                 ; create a tool using extruder drive 1 and heater 2 with X movement mapped to the U axis
M563 P2 D0:1 H1:2 X0:3 F0:2 ; create a tool using extruder drives 0 and 1, heaters 1 and 2, with X movement mapped to both X and U axes and fan 0 mapped to fan 0 and fan 2

Tools are usually (though not necessarily) extruders. The 'P' field specifies the tool number. Tool numbers can have any positive integer value and 0. The 'D' field specifies the drive(s) used by the tool - in the first example drives 0, 2 and 3. Drive 0 is the first drive in the machine after the movement drives (usually X, Y and Z). If there is no 'D' field the tool has no drives. The 'H' field specifies the tool's heaters - in the first example heaters 1 and 3. Heater 0 is usually the hot bed (if any) so the first extruder heater is usually 1. If there is no H field the tool has no heaters.

Tools are driven using multiple values in the 'E' field of G1 commands, each controlling the corresponding drive in the 'D' field above, as follows:

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

The first line moves straight to the point (90.6, 13.8) extruding a total of 2.24mm of filament from both drives 0 and 2 and 15.98mm of filament from drive 3. The second line moves back 20mm in X extruding 42.4mm of filament from drive 3.

Alternatively, if the slicer does not support generating G1 commands with multiple values for the extrusion amount, the M567 command can be used to define a tool mix ratio.

Normally an M563 command is immediately followed by a G10 command to set the tool's offsets and temperatures.

It is permissible for different tools to share some (or all) of their drives and heaters. So, for example, you can define two tools with identical hardware, but that just operate at different temperatures.

The X mapping option is used to create tools on machines with multiple independent X carriages. The additional carriages are set up as axes U, V etc. (see M584) and the X mapping option in M563 defines which carriage or carriages are used.

If you use the M563 command with a P value for a tool that has already been defined, that tool is redefined using the new values you provide.

RepRapFirmware supports an additional form of the M563 command. The command:

M563 S1

means add 1 (the value of the S parameter) to all tool numbers found in the remainder of the current input stream (e.g. the current file if the command is read from a file on the SD card), or until a new M563 command of this form is executed. The purpose of this is to provide compatibility between systems in which tool numbers start at 1, and programs such as slic3r that assume tools are numbered from zero.

Recent versions of RepRapFirmware allow the deletion of existing tools if M563 is called in this way:

M563 P1 D-1 H-1

M564: Limit axes

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Snnn Limit movement within axis boundaries
Example
M564 S0

Allow moves outside the print volume, or not. If the S parameter is 0, then you can send G codes to drive the RepRap outside its normal working volume, and it will attempt to do so. User beware... If you set the S parameter to 1 then the RepRap will not think outside the box. The default behaviour is S = 1.

M565: Set Z probe offset

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Да see G31 Нет ??? ??? ??? Нет

Example: M565 X3 Y4.5 Z-2.37

Set the offset from the extruder tip to the probe position. The X, Y and Z values are the delta between the extruder and the actual trigger position of the probe. If the probe trigger point is below the extruder (typical) the Z offset will be negative. This just records the point offset; it does not actually do the probing. See G32.

M566: Set allowable instantaneous speed change

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Xnnn Maximum instantaneous speed change of the X axis (mm/min)
Ynnn Maximum instantaneous speed change of the Y axis
Znnn Maximum instantaneous speed change of the Z axis
Ennn Maximum instantaneous speed change of the extruder drives
Example
M566 X20 Y20 Z2 E10

Sets the maximum allowable speed change (sometimes called 'jerk speed') of each motor when changing direction.

The model files and gcode files used by repraps generally render circles and other curves shapes as a sequence of straight line segments. If the motors were not allowed any instantaneous speed change, they would have to come to a stop at the junction between each pair of line segments. By allowing a certain amount of instantaneous speed change, printing speed can be maintained when the angle between the two line segments is small enough.

If you set these X and Y values too low, then the printer will be slow at printing curves. If they are too high then the printer may be noisy when cornering and you may suffer ringing and other print artefacts, or even missed steps.

On very old versions of RepRapFirmware (prior to 1.09), these were also the minimum speeds of each axis.

M567: Set tool mix ratios

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Tool number
Snnn Whether mix ratios should be activated
Example
M568 P2 S0

Turn on/off automatic mix ratios for tool 2. If the S parameter is 0 mixing is turned off; if it is non-zero it is turned on.

After turning off command G1 instructions must send as many E values as the tool has drives:

G1 X20 E0.2:0.4:0.166:0.3

The off state is the default.

M569: Set axis direction and enable values

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Motor driver number
Snnn Direction of movement of the motor(s) attached to this driver: 0 = backwards, 1 = forwards
Rnnn Driver enable polarity: 0 = active low, 1 = active high (default 0)
Tnnn Minimum driver step pulse width and interval in microseconds1
Example
M569 P0 S1

Set the control value for the drive specified by P that sends it forwards to the given value in the S field. After sending the example, sending a 1 to X (drive 0) will make it go forwards, sending a 0 will make it go backwards. Obviously to be used with extreme caution...

Notes

1RepRapFirmware 1.14 and later support the T parameter, to allow the step pulse width and interval to be lengthened for those drivers that need it. If no T parameter is given, then the step pulse width and interval are guaranteed to be suitable for the on-board drivers. Currently, RepRapFirmware only remembers the highest T parameter seen in any M569 command, and applies that value to all drivers for which any nonzero T parameter was specified.

Some versions of RepRapFirmware prior to 1.14 also provide XYZ 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
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)
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Snnn Output value
Example
M571 S0.5

This turns the controlled fan 0 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. The S parameter sets the value of the PWM to the output. 0.0 is off; 1.0 is fully on. It also can be used to control a laser beam.

M572: Set or report extruder pressure advance

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет dc42, ch, dn Нет ??? ??? ??? Нет
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: Report heater PWM

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Heater number
Example
M573 P1

This gives a running average (usually taken over about five seconds) of the PWM to the heater specified by the P field. If you know the voltage of the supply and the resistance of the heater this allows you to work out the power going to the heater. Scale: 0 to 1.

M574: Set endstop configuration

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Xnnn Switch type for X axis
Ynnn Switch type for Y axis
Znnn Switch type for Z axis
E Select extruder endstops to define active high or low
Snnn Logic level
Example
M574 X1 Y2 Z0 S1

This defines the type of endstop switch or opto sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default) or low (S0). Intended for use with boards that provide a single endstop input for each axis that may be used for either a high or a low end endstop, such as the Duet. Supported by RepRapFirmware. On delta printers, the XYZ parameters refer to the towers and the endstops should normally all be high end. For the extruders endstops, S0 is for active low and S1 for active high. M574 E S1 select active high (used when endstop is a Z-probe, needed from v.1.14) - for all extruder endstops

M575: Set serial comms parameters

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Pnnn Serial channel number
Bnnn Baud rate
Snnn Whether checksums should be used
Example
M575 P1 B57600 S1

This sets the communications parameters of the serial comms channel specified by the P parameter. P0 specifies the main serial interface (typically a USB port, or serial-over-USB), while P1 specifies an auxiliary serial port (for example, the port used to connect a PanelDue). The B parameter is the required baud rate (this parameter is typically ignored if the port is a true USB port). The S parameter is a bitmap of features. The lowest bit, if set, specifies that only commands that include a valid checksum should be accepted from this comms channel.

M577: Wait until endstop is triggered

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Нет ??? ??? Нет
Parameters
Snnn Desired endstop level
Xnnn Select X axis endstop
Ynnn Select Y axis endstop
Znnn Select Z axis endstop
Ennn Select extruder drive endstop
Example
M577 E0 S1

Wait for an endstop switch to be pressed. The example above will wait until the first extruder endstop is triggered.

The following trigger types may be used using the 'S' parameter:

0: Endstop not hit 1: Low endstop hit 2: High endstop hit 3: Near endstop (only Z probe)

M578: Fire inkjet bits

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Нет ??? ??? Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Нет ??? ??? Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Нет ??? ??? Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет dc42 Нет Нет ??? ??? Нет
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 an 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет dc42 Нет Нет ??? ??? Нет
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.

M583: Wait for pin

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет {soon} Нет Нет ??? ??? Нет
Parameters
Pnnn Pin number
Sn State to wait for (0 or 1) or analogue tolerance
Rnnn Analogue value to wait for (between 0.0 and 1.0)
Example
M583 P5 S0 ; Wait for Pin 5 to become 0

This allows you, for example, to turn on a DC motor (see the M42 command) then wait until a switch connected to Pin Pnnn gives the value Sn.

If the R field is present, then the system waits until the value on analogue Pnnn is reached. In this case the S value is used as a tolerance, so M583 P8 R0.7 S0.01 would wait until the analogue value on Pin 8 was between 0.69 and 0.71.

M584: Set drive mapping

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Version 1.14 and later Нет Нет ??? ??? Нет
Parameters
Xnnn Driver number(s) for X motor(s)
Ynnn Driver number(s) for Y motor(s)
Znnn Driver number(s) for Y motor(s)
U,V,Wnnn Driver number(s) for additional axes U, V and W (RepRapFirmware 1.16 and later)
Ennn Driver number(s) for E motor(s)
Snnn Special functions (to be defined)
Example
M584 X0 Y1 Z2:3 E4:5:6 ; Driver 0 controls the X motor, 1 controls the Y motor, 2 and 3 control the Z motors, 4 and 5 control the 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. You should not create axis W unless you also create axis V, and you should not create axis V unless you also create axis U.

M585: Probe Tool

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Шаблон:Soon Нет Нет ??? ??? Нет

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

M590: Report current tool type and index

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет Нет Нет Нет Нет

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

M600: Set line cross section

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет ??? ??? Нет Да ??? ??? ??? Нет

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? ??? Use macro files instead Нет ??? ??? ??? Да

Example: M600

Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal].

M605: Set dual x-carriage movement mode

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да ??? Нет Use M563 Нет ??? ??? ??? Да

Example: M605 S1

Sets the dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ].

M605 S0: Full control mode. The slicer has full control over x-carriage movement M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn millimeters x-offset and an optional differential hotend temperature of mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate the first with a spacing of 100mm in the x direction and 2 degrees hotter.

M665: Set delta configuration

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Да Да Нет ??? ??? ??? Да
Parameters
Lnnn Diagonal rod length
Rnnn Delta radius
Snnn Segments per second1
Bnnn Safe printing radius2
Hnnn Nozzle height above the bed when homed after allowing for endstop corrections2
Xnnn X tower position correction3
Ynnn Y tower position correction3
Znnn Z tower position correction3
Examples
M665 L250 R160 S200 (Marlin)
M665 L250 R160 B80 H240 X0 Y0 Z0 (RepRapFirmware)

Set the delta calibration variables.

I don't think it's a good idea to have two different implementations for the same G-code, and I also question the practical value of specifying the print bed radius when defining a delta configuration, since many delta printers use a square or rectangular print bed. So perhaps we should stick to the Marlin-defined command as the definition for this command, and use a different command or set of commands to define print bed shape and size. --AndrewBCN (talk) 23:10, 31 January 2015 (PST)
The implementations are not different, they have the same L and R parameters, but each has additional parameters that are not relevant to the other implementation. I'm not against defining a new Gcode to define bed size and shape; however, you can already define the limits of a rectangular print area using M208. Even when a delta printer has a square bed, the printable area is not square. It is usually taken to be circular, although it is in reality more complicated. My purpose in adding the B parameter was to make it easy to define a radius outside which movement will not normally be attempted. I have changed "bed radius" to "safe printing radius" in the text to help clarify this. --dc42
Notes

1Only supported on Marlin.

2Only supported in RepRapFirmware.

3X, Y and Z tower angular offsets from the ideal (i.e. equilateral triangle) positions, in degrees, measured anti-clockwise looking down on the printer.

M666: Set delta endstop adjustment

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да Да Да Нет ??? ??? ??? Да
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.

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? Нет
Parameters
Snnn CoreXY mode
Xnnn X axis scale factor
Ynnn Y axis scale factor
Znnn Z axis scale factor
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.

M667 S3 selects CoreYZ mode. Forward movement of the Y motor moves the head in the +Y and +Z directions. Forward movement of the Z motor moves the head in the -Y and +Z directions.

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.

To change the motor directions, see the M569 command.

M668: Set Z-offset compensations polynomial

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет dc42-cmm Нет ??? ??? ??? Нет

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 use would be:

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

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

M700: Level plate

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет bq Нет Нет Нет Нет Нет Нет Нет bq


Example: M700

Script to adjust the plate level.

M701: Load filament

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет bq Нет Нет Нет Нет Нет Нет Нет bq

1 only in bq-Marlin Firmware

Example: M701

M702: Unload filament

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет bq Нет Нет Нет Нет Нет Нет Нет bq

1 only in bq-Marlin Firmware

Example: M702

M703: Get Board Type

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет bq Нет Нет Нет Нет Нет Нет Нет bq

1 only in bq-Marlin Firmware

Example: M703

M710: Erase the EEPROM and reset the board

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет bq Нет Нет Нет Нет Нет Нет Нет bq

1 only in bq-Marlin Firmware

Example: M710

M800: Fire start print procedure

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет bq Нет Нет Нет Нет Нет Нет Нет bq

1 only in bq-Marlin Firmware

Example: M800

M801: Fire end print procedure

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет bq Нет Нет Нет Нет Нет Нет Нет bq

1 only in bq-Marlin Firmware

Example: M801

M851: Set Z-Probe Offset

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? Да ??? ??? Use G31 ??? ??? ??? ??? Да

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 up 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

M905: Set local date and time

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет coming soon Нет ??? ??? Нет Нет
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет M907? Да Нет ??? ??? Да Нет
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 current idle factor (0..100)1
H1 Set/Get Motor currents used for the downward Z-probe homing movement 2
Example
M906 X300 Y500 Z200 E350:350

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

Notes

1RepRapFirmware supports an additional I parameter. This 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%.

2RepRapFirmware, DC42 version, cmm sub-version supports "H1", which sets the XYZ motor currents used during Z-probing temporarily to different (typically lower) value. If "H1" is specified, the homing current is set, otherwise it operates normally. The homing current should be specified after the main current is set. The actual motor current is not changed until the next Z-probe operation. Lower motor currents reduce vibration during Z-probe motions.

M907: Set digital trimpot motor

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да Да Use M906 Нет ??? ??? Да Да

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 A (where M906 does in mA).

M908: Control digital trimpot directly

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Да: 0.92 Нет Нет Нет ??? ??? ??? Да

M908 P<pin> S<current>

M909: Set microstepping

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Use M350 Use M350 Нет Use M350 Нет ??? ??? Да Use M350

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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Нет Нет ??? ??? Да Нет

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.

M911: Set power monitor threshold voltages

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет
Parameters
Pnnn Power monitor channel, default 0
Snnn Undervoltage threshold
Tnnn Overvoltage threshold

Example:

M911 P0 S20 T27.5

Sets the minimum supply voltage for which correct operation of the printer mechanics is guaranteed and stepper motor positions are guaranteed to be held for all enabled drivers, and/or the maximum safe voltage above which sensitive parts of the machine should be shut down. M911 with no parameters or with just the P parameter reports the current thresholds.

M912: Set electronics temperature monitor adjustment

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет
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.

M913: Set motor percentage of normal current

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? Нет Нет
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, 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.

M928: Start SD logging

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Нет Нет Нет ??? ??? ??? Да

Example:

M928 filename.g

Stop SD logging with M29.

M997: Perform in-application firmware update

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет Нет ??? Нет Нет
Parameters
Snnn Firmware module number(s), default 0
Example
M997 S0:1 - update firmware modules 0 and 1

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, filename sys/RepRapFirmware.bin (Duet) or sys/DuetWiFiFirmware (Duet WiFi). File sys/iap.bin (Duet) or sys/iap4e.bin (Duet WiFi) must also be present.

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

2 - 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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Нет Нет Нет Да Нет ??? ??? ??? ???
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 GCode interpreter to request the resend.

M999: Restart after being stopped by error

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Нет Нет Нет Да Нет Да Да Нет ??? ??? ??? Да
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

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? Нет ??? ??? Нет ??? ??? ??? Да Нет

Example: G

This lists all implemeted G-codes in the firmware with description and sends it back to the host.
(Note: this has been implemented in Redeem, and so is only a proposition)

M: List all M-codes

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
??? ??? ??? Нет ??? ??? Нет ??? ??? ??? Да Нет

Example: M

This lists all implemeted M-codes in the firmware with description and sends it back to the host.
(Note: this has been implemented in Redeem, and so is only a proposition)

T: Select Tool

Поддержка FiveD Teacup Sprinter Marlin Repetier Smoothie RepRapFirmware Machinekit MakerBot   grbl   Redeem MK4duo
Да Да Нет Да Да Да Да ??? ??? ??? Да Да
Parameters
This command can be used without any additional parameters.
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 implementations (e.g. RepRapFirmware) allow you to specify tool-change G Code macros2. 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.

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 Under special circumstances, the execution of those macro files may not be desired. RepRapFirmware 109p-ch allows the 'S0' parameter to be passed to prevent the execution of tool change macro files.

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.

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 and 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

rs

!!

ok means that no error has been detected.

rs means resend, and is followed by the line number to resend.

!! means that a hardware fault has been detected. The RepRap machine will shut down immediately after it has sent this message.

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

On the latest version of Pronterface and soon Octoprint a special comment of the form:

// action:command

is allowed to be sent from the firmware, the command can currently be pause, resume or disconnect which will execute those commands on the host. As this is also a comment other hosts will just ignore these commands.

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.

All this means that every line sent by RepRap to the host computer except the start line has a two-character prefix (one of ok, rs, !! or //). The machine should never send a line without such a prefix.


Exceptions:

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. The dc42 fork of 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
  • M105 S3
  • 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.