Supported G codes
This page is under construction!
G-codes
G0 & G1
Move
G2 & G3
Arc move.
G4
Pause the machine for a period of time.
Parameters
PnnnTime to wait, in millisecondsSnnnTime to wait, in secondsExample
G4 S2Waits for 2 seconds.G10
Retract
G11
Retract recover
G28
Home axis
Examples:
G28 WHome x, y and z axes.
G28Home x, y and z axes and then runs mesh bed leveling (G80).G30
Single Z Probe
G76
Induction probe temperature calibration.
Induction probe (PINDA) detection distance increases with temperature. This leads to need of adjusting live adjust Z values often, expecially when printing with different materials. Main contributor to PINDA temperature shift is heat received from heatbed.
G76 runs temperature calibration, which consist of preheating PINDA probe near the heatbed surface for different heatbed temperatures and measuring how its detection distance changes. Measured detection distance shifts are saved to EEPROM.
When new print is started and using temperature calibration is turned on in Calibration -> Temp. calibration menu, PINDA probe is preheated for two minutes near the heatbed again to achieve defined temperature. Then mesh bed leveling is run and Z axis shift counted from temperature calibration data is applied. Then live adjust Z is applied.
G80
Mesh bed leveling
G81
Print mesh bed leveling status and bed profile if activated
G86
Prusa3D specific
Disable babystep correction after home. This G-code will be performed at the start of a calibration script.
G87
Prusa3D specific
Enable babystep correction after home. This G-code will be performed at the end of a calibration script.
G90
All coordinates from now on are absolute relative to the origin of the machine.
G91
All coordinates from now on are relative to the last position.
G92
Set position to coordinates given without physical movement.
G98
Activate farm mode
G99
Deactivate farm mode
M-codes
M0 & M1
Wait for user to press the knob. This command can be used without additional parameters or with:
PnnnTime to wait, in millisecondsSnnnTime to wait, in secondsExamples:
M1Waits until user presses the knob. “Wait for user…” message is shown as LCD status message.
M1 S2Waits until user presses the knob. Max. waiting time is 2s. “Wait for user…” message is shown as LCD status message.
M1 Hello WorldWaits until user presses the knob. “Hello World” message is shown as LCD status message.M17
Power all stepper motors.
M20
List SD card
M21
Init SD card
M22
Release SD card
M23
Select file
M24
Start SD print
M25
Pause SD print
M26
Set SD index
M27
Get SD status
M28
Begin write to SD card.
Example:
M28 filename.gcoFile specified by filename.gco is created (or overwritten if it exists) on the SD card and all subsequent commands sent to the machine are written to that file. Writing to file is terminated with M29.M29
Stop SD write.
M30
Delete SD file
M31
Show time from print start.
M32
Select file and start SD print
M42
Change pin status via gcode
M44
Reset XYZ calibration
M45
XYZ/Z calibration
Example:
M45Runs XYZ calibration.
M45 ZRuns Z calibration.M47
Show end stops dialog on display. Wait for user to press the knob.
M82
Set E coordinates absolute.
M83
Set E coordinates relative.
M84
Turn off steppers.
M85
Set inactivity shutdown timer.
M92
Set axis steps per unit.
M104
Sets target temperature for nozzle. Example:
M104 S210Sets nozzle target temperature to 210 C.M105
Returns current temperatures.
M106
Turn on printer fan.
M107
Turn off printer fan.
M109
Set target temperature for nozzle and wait for nozzle to reach target.
M110
Reset line position.
M112
Emergency stop
M113
Set or get host keepalive interval.
M114
Current position on serial.
M117
Prints custom status message on LCD.
Example:
M117 Hello WorldM119
Report current endstop status on serial
M120
Disable endstops
M121
Enable endstops
M140
Set heatbed target temperature. Example:
M140 S60Sets heatbed target temperature to 60 C.M190
Set heatbed target temperature and wait for heatbed to reach target.
M203
Set max. feedrate in mm/sec.
M204
Sets acceleration.
S – normal moves
T – filament only moves
Example:
M204 S1000M205
M207
M208
M209
M220
Set speed factor override percentage.
Exmaple:
M220 Sxxx-sets speed factor
M220 Sxxx B-backups current speed factor and then sets new speed factor
M220 B-just backups current speed factor
M220 R-restore saved speed factorM221
Set extrude factor override percentage.
M226
M300
Activate beeper
M301
Set PID values
M302
Allow cold extrude or set cold extrude limit.
M303
PID autotune
M304
Set hetbed PID values
M350
M351
M400
Finish all moves
M500
Store settings to eeprom
M501
Read settings from eeprom
M502
Revert to default settings
M503
Print settings currently in memory
M509
Force language selection. This command will invoke language selection menu after reseting/rebooting the printer.
M600
Pause for filament change.
M601
Long pause
Suitable for pausing sd card print. Long pause print procedure contains seting nozzle target temperature to zero, moving extruder to pause print position and turning off print fan. When nozzle cools down nozzle fan is also turned off and printer remains silent during pause. Heatbed remains heated during pause print to maintain good attachement between printed object and heatbed. In pause position heatbed with printed object is moved foward to make printed object accessible.
M602
Resume SD card print from long pause. Previous print settings (fan speed and feemultiply, nozzle target temperature) are restored. Time when the printer is paused is not counted to print time statistics.
M701
Load filament
When using multi material printer M701 loads filament in currently active extruder.
M702
Unload filament
Multi material usage:
With multi material firmware, it is possible to unload all filaments, all filaments which were used during previous print or just current filament.
Example:
M702Unloads all filaments
M702 UUnloads all filaments used during print
M702 CUnloads filament in currently active extruderM907
Set stepper motor current
T-Codes
Select tool. This is used with multi material printer for switching between extruders.
Example:
T0First extruder (counted from the left) will be used.
T?Envokes menu on LCD display for selecting which extruder to use.PRUSA-codes
PRUSA Ping
Works only in farm mode. This code serves for checking that communication is not broken.
PRUSA PRN
PRUSA Fn
PRUSA fv
Source: Supported G codes · prusa3d/Prusa-Firmware Wiki · GitHub