3D printing g code commands


Beginners Guide to 3D Printing G-Code Commands

Did you know that 3D printers have their own language? Today, many desktop 3D printers use a numerically controlled programming language made up of a series of commands called G-Code. Most of these commands start with a G (hence the name), but there are also some common machine-specific codes that start with an M. These commands tell your 3D printer exactly what actions to perform – where to move, what speed to use, what temperatures to set, and much more. For any maker, it is beneficial to have a basic knowledge of G-Code to understand how your 3D printer works, debug or perform maintenance on your machine, and verify your print files.  This guide will explain the 10 most commonly used commands, what they do, and how to edit them in Simplify3D.

When slicing your model in Simplify3D the software will automatically generate the G-Code commands necessary to complete the print. You can view these commands by clicking “Save Toolpaths to Disk”, selecting a location for the file on your hard drive, and then opening the . gcode file in a text editor like Notepad or TextEdit. If you happen to be using Notepad++, you can download this handy XML file that will enable syntax highlighting for your gcode files, just like the image at the top of this article. To import the file in Notepad++, go to Language > Define your language, click Import, and select the XML file.

Although G-Code is the standard language for most 3D printers, some machines may use different file formats or commands. Even if your printer uses a different file format such as an .x3g file, please note that Simplify3D will still export both the .gcode and .x3g files to the location that you select. This is quite useful, as many of the other file formats are actually binary files. Viewing the text in the gcode file is much easier than readings lots of 1’s and 0’s in the binary files!

After you open your .gcode file in a text editor, you will notice that each command is typically listed on a separate line. The start of the line tells you what type of command it is, and then there may be several additional arguments that follow. You can even add comments within the file by placing a semi-colon before the comment so that it is ignored by the machine. So now that you have seen an example of what your 3D print files look like, here is our list of the 10 most common commands you need to know.

The 10 Most Common G-Code Commands for 3D Printing

For each command, we will provide a description of what the command does, specify what arguments may be needed, and even provide a few sample commands so that you can see how it is commonly used.

G28 – Perform Homing Routine

This command tells the printer to run its homing sequence, which will move the toolhead to the far edges of the machine until it contacts the endstops at these locations. Most of your print files will begin with this command so that the printer starts from a known location. This is also a useful way to quickly move one axis out of the way, which may be useful at the end of a print so that you can remove your part.

Arguments:
If no arguments are provided, the machine will home all 3 axes. You can also specify which exact axes you want to home by adding an X, Y, or Z to the command.

Example usage:
G28 ; home all axes (X, Y, and Z)

G28 X Y ; home X and Y axes

G28 Z ; home Z axis only

G90 and G91 – Set Positioning Mode
Your printer can use either absolute or relative positioning. Absolute positioning means that you will be telling your 3D printer to move an exact XYZ coordinate. Relative positioning is used when you want to tell the printer how far it should move from the current location. Send a G90 command to tell your printer to use absolute positioning, or a G91 for relative positioning. The majority of your gcode file will likely use absolute positioning, since the slicer has already determined the exact XYZ coordinates to move to. However, if you don’t know the previous position of the toolhead, or you simply know that you want to move the head a certain distance along an axis, you can use relative positioning. While G90 and G91 control the positioning mode for the X, Y, and Z axes, you can also use M82 or M83 to set your extruder (E-axis) to absolute or relative positioning.

Arguments:
None

Example usage:
G90 ; use absolute positioning for the XYZ axes
G1 X10 F3600 ; move to the X=10mm position on the bed
G1 X20 F3600 ; move to X=20mm

G91 ; use relative positioning for the XYZ axes
G1 X10 F3600 ; move 10mm to the right of the current location
G1 X10 F3600 ; move another 10mm to the right

G1 – Linear Movement

This command probably makes up 95% of your gcode files, so it is a good one to learn! The G1 command tells your printer to move in a straight line to the location that you specify. You can use this to move just a single axis, or multiple axes at once. Keep in mind that your extruder is controlled just like any other axis, so you can also use this command to extrude or retract filament from the nozzle.

Arguments:
Use X, Y, or Z values to tell the printer what position to move to. Keep in mind that these values will obey the current positioning mode, so you can specify them using either absolute or relative coordinates. Include an E value if you want to move the extruder as well. The E value corresponds to the position of your filament spool, so if you move the E axis by 10mm, that would cause 10mm of your filament to be pushed into the nozzle. Since the nozzle diameter is usually much smaller than your filament diameter, 10mm of filament pushed into the nozzle may create an extrusion that is hundreds of millimeters long! For this reason, the E values that you will see in your file are typically quite small compared to the X, Y, and Z values. Finally, you can use an F value to tell the printer what speed to use for the movement. This speed must always specified in units of mm/min, so even if you use mm/s in your slicing software, you will still need use mm/min anytime you are sending a command directly to the printer.

Most printers support “sticky” coordinates, which means that you only need to specify the arguments for the axes you actually want to move. So if you only wanted to move the Z axis, you would just include the Z argument as well as an F value to define the speed.

Example usage:
G1 X0 Y0 F2400 ; move to the X=0 Y=0 position on the bed at a speed of 2400 mm/min
G1 Z10 F1200 ; move the Z-axis to Z=10mm at a slower speed of 1200 mm/min
G1 X30 E10 F1800 ; push 10mm of filament into the nozzle while moving to the X=30 position at the same time

G92 – Set Current Position
Use this command to set the current position of your axes. This can be useful if you want to change or offset the location of one of your axes. One of the most common uses for this command is actually with your E axis (the filament position). You can quickly override the current filament position so that all future commands will now be relative to this new value. It is common to do this at the start of each layer or right before a prime or retraction command.

Arguments:
Specify the absolute coordinate for any axis that you wish to overwrite. You can include the X, Y, Z, and E axes. If you do not include one of these axes in the command, the position will remain unchanged.

Example usage:
G92 E0 ; set the current filament position to E=0
G1 E10 F800 ; extrude 10mm of filament

M104 and M109 – Extruder Heating Commands

Use these commands to set the temperature of your extruder. The M104 command starts heating the extruder, but then allows you to run other commands immediately afterwards. The M109 command will actually wait until the desired temperature is reached before allowing any other commands to run. For this reason, you will frequently see an M109 at the top of your Simplify3D gcode files, as this allows the extruder to reach the necessary temperature before the print begins.

While most machines use M104 and M109, some firmwares may use slightly different commands. For example, if you are using a machine that reads x3g files, then you may use an M133 command for stabilizing your extruder instead of M109. If you are using a machine that runs a variant of the FlashForge Dreamer or Dremel firmwares, you’ll want to use an M6 command to stabilize your extruder. You can check what firmware type you are using in Simplify3D by going to Tools > Firmware Configuration.

Arguments:
The S value specifies the extruder temperature in degrees Celsius. The T value can be used if you have more than one extruder, as it allows you to specify which exact extruder temperature you want to set. If you have a dual extrusion machine, typically T0 is the right extruder, and T1 is the left extruder. If you only have a single extruder machine, you can typically omit the T parameter entirely.

Example usage:
M104 S190 T0 ; start heating T0 to 190 degrees Celsius
G28 X0 ; home the X axis while the extruder is still heating
M109 S190 T0 ; wait for T0 to reach 190 degrees before continuing with any other commands

M140 and M190 – Bed Heating Commands
Use these commands to set the temperature of your heated build platform. The syntax is very similar to the M104 and M109 commands mentioned above. Sending the M140 command begins heating the bed, but allows you to run other commands immediately afterwards. The M190 command will wait until the bed temperature is reached before allowing any other commands to run. Keep in mind that the heated bed on your printer may take several minutes to reach elevated temperatures. So don’t be surprised if you see your printer pausing while waiting on an M190 command to finish heating the bed. Because this process can take a long time, it may be a good idea to start heating the bed at the beginning of your routine using an M140 command, which would allow you to do other actions such as homing or nozzle purging while the bed is still pre-heating. Just make sure to include an M190 before the print begins, as the bed temperature can be an important factor for first layer adhesion.

As with the M104 and M109 commands, these bed heating commands can differ depending on what firmware you are using. If your machine reads x3g files, then you can use the M134 command for stabilizing your bed instead of M190. If you are using a variant of the FlashForge Dreamer or Dremel firmwares, you’ll want to use an M7 command to stabilize your bed.

Arguments:
The S value specifies the bed temperature in degrees Celsius. No other arguments are typically needed, as most machines only have a single heated build platform.

Example usage:
M140 S50 ; start heating the bed to 50 degrees Celsius
G28 ; home all 3 axes while the bed is still heating
M190 S50 ; wait until the bed reaches 50 degrees before continuing

M106 – Set Fan Speed
This command allows you to set the speed of your printer’s part cooling fan. This is an external cooling fan that is pointed towards the part that you are printing. Keep in mind that your printer may also have an extruder fan that helps cool the extruder drive mechanism, so make sure you are looking at the correct fan first. While most printers have an external cooling fan, there are a few exceptions, so check your machine first to make sure it has an external cooling fan that you can control.

Arguments:
The S value sets the speed of the cooling fan in a range between 0 (off) and 255 (full power).

Example usage:
M106 S255 ; set the fan to full speed

M106 S127 ; set the fan to roughly 50% power

M106 S0 ; turn off the fan completely

How to Send or Edit G-Code Commands

If your machine accepts normal gcode files like most RepRap machines, then a great way to test different commands is by manually sending them one-at-a-time to see how your printer responds. You can do this within Simplify3D by going to Tools > Machine Control Panel. Once in the Machine Control Panel make sure you are connected to your 3D printer and then use the Communications tab to send your printer a line of G-Code. Just type the command that you want to send at the bottom of the window and then press the Send button. None of the commands mentioned in this article are permanent, so you can always reboot the printer if you want to stop what the machine is doing or get back to a fresh state.

Once you feel comfortable with the commands, you may find that you want to run the same series of commands before or after each print. Thankfully, Simplify3D gives you the ability to customize the routines that are run at the start and end of each print, so you can easily update your settings so that your 3D printer automatically performs these actions. To do this, click “Edit Process Settings” and then select the Scripts tab. There are several different scripts on this tab that you can edit. Each one is used at different times during your print. For example, the Starting script is used at the very beginning of the print, while the Ending script is run at the very end of the print. Depending on where you want to make your changes select the appropriate categories and start editing. The default profile that Simplify3D provides for your 3D printer will already include scripts that we have tested and verified, so you can use these as a starting point.

Each time you make a change to these scripts, you can try running a quick test print to make sure the printer behaves like you would expect. Once you are happy with the changes, you can use Simplify3D’s profile management system to permanently save these new settings for future prints. You can even create multiple versions of your profile if you want to keep track of your changes along the way.

We have now covered all the fundamentals you’ll need to begin testing G-Code on your 3D printer. If you are interested in other tutorials like this that can help teach you the basics of 3D printing, click here to view our full article library.

View the Complete Article Library

Most used 3D Printer G-Codes

What are the 3D Printer G CODES and why they are important ? Check this guide to learn the most useful commands, and also how to use it!
Please, keep in mind that this tutorial designed for Marlin / Repetier firmwares, it is not guaranteed to work with another firmware,

1 What is a 3D Printer G-code?

1. 1 How to send 3D Printer g-codes to the printer?

1.2 What can a G-CODE do for me?

1.2.1 Using G-Code, you can set up scripts on your 3D printer, for example:

1.2.2 How we do this? using some G-codes!!!

What is a 3D Printer G-code?

G-code (a.k.a RS-274), which has many variants, is the common name for the most widely used numerical control (NC) programming language. It is used mainly in computer-aided manufacturing to control automated machine tools (like CNC’s and 3D printers). G-code is sometimes called G programming language

How to send  3D Printer g-codes to the printer?

In repetier host, you should first connect the printer, then go to Manual control and write the code on this box:

then just press SEND.

In Simplify3D, you need to open the tools > Machine control Panel. in the control panel, choose Communication

Remember!, the letters should be in in CAPITAL, example: G1 X-1 Works | g1 x-1 may not work

What can a G-CODE do for me?
Using G-Code, you can set up scripts on your 3D printer, for example:

I want that my printer, before it start printing,

my bed to 110ºC
– heat my nozzle to 180ºC
– go home
– do auto-leveling
– heat the nozzle up to 230ºC
– move nozzle to the left corner, off the bed
– extrude 10mm of plastic (to clean the nozzle)
– start printing

How we do this? using some G-codes!!!

M140 S110 // this will heat the bed to 110 degrees
M104 S180 T0 // this will heat the nozzle to 180 degrees
G28 // Go home! (if you don’t define X, Y or Z, it will go home to all of them)
G29 // do the auto-leveling feature
G28 X // it will go home on the X axis again
G91 // This is needed to move the extruder!
G1 E10 F240 // This will extrude 10mm of plastic
G90 // This is needed to move the extruder!

Wow!, too much strange commands right? well, they are worthy to know!, and this is what i’m gonna show you!

On simplify 3D you can set those scripts here:

On repetier you can set those scripts here:

 

MOST USEFUL 3D PRINTER G-CODES
(and how to use them)
G0 and G1: Move

G0 = Rapid linear Move (this means it will go FASTER)
G1 = Linear Move (normal speed)

How to use?
G0 Xnnn Ynnn Znnn Ennn Fnnn Snnn
G1 Xnnn Ynnn Znnn Ennn Fnnn Snnn

What the hell is this italo?
Well, most of the commands accept multiple moves at time, this means that if you send this:
G1 X100 Y100 Z100 E10
The nozzle will move 100mm on X, 100mm on Y, 100mm on Z, while extruding 10mm of plastic.

But you can also move only one at time!, example:
G1 X10 = X axis will move 10mm

G2 & G3: Controlled Arc Move

G2 Xnnn Ynnn Innn Jnnn Ennn Fnnn (Clockwise Arc)
G3 Xnnn Ynnn Innn Jnnn Ennn Fnnn (Counter-Clockwise Arc)
Parameters
Xnnn The position to move to on the X axis
Ynnn The position to move to on the Y axis
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 The amount to extrude between the starting point and ending point
Fnnn The feedrate per minute of the move between the starting point and ending point (if supplied)
Examples
G2 X90.6 Y13.8 I5 J10 E22.4 (Move in a Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22. 4mm of material between starting and stopping)
G3 X90.6 Y13.8 I5 J10 E22.4 (Move in a Counter-Clockwise arc from the current point to point (X=90.6,Y=13.8), with a center point at (X=current_X+5, Y=current_Y+10), extruding 22.4mm of material between starting and stopping)
Why use it?

Notes

1In Marlin Firmware not implemented for DELTA and SCARA printers.

G4 Dwell (a.k.a delay or pause)

G4 Pnnn
Pnnn Time to wait, in milliseconds

Example
G4 P200
In this case sit still doing nothing for 200 milliseconds. During delays the state of the machine (for example the temperatures of its extruders) will still be preserved and controlled.

G10 and G11 – Retract and Unretract

If you send G10 (the hotend must be hot, otherwise it wont do nothing) will retract the filament. and when you send G11, it will unretract, this can be useful to stop oozing. but there are more effectives methods as proper calibration or cleaning scripts.  the distance can be set on the firmware or via software if you have EEPROM enabled

G28: Move to Origin (Home)

This command can be used without any additional parameters.
X Flag to go back to the X axis origin
Y Flag to go back to the Y axis origin
Z Flag to go back to the Z axis origin
Examples
G28 (Go to origin on all axes)
G28 X Z (Go to origin only on the X and Z axis)

G29: Detailed Z-Probe – (a.k.a auto leveling)

Example: G29
Probes the bed at 3 or more points. The printer must be homed with G28 before G29.

Please notice that for using this, you need to have a configured and working system!, check more in my another tutorial here: Click here to open the AutoLeveling tutorial

G90 and G91: Set to Absolute/Relative Positioning

Example: G90
All coordinates from now on are absolute relative to the origin of the machine. (This is the default.)

Example: G91
All coordinates from now on are relative to the last position.

G92: Set Position

This command can be used without any additional parameters.
Xnnn new X axis position
Ynnn new Y axis position
Znnn new Z axis position
Ennn new extruder position

Example

G92 X10 E90
Allows programming of absolute zero point, by resetting the current position to the values specified. This would set the machine’s X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur.
A G92 without coordinates will reset all axes to zero.

Note that this can be dangerous!, if you are on X200, and your X-Max is 210mm, the printer will think that the hotend is at 0, and will let it to move more 200mm (200+200 = bad idea, and probably a lot of noise).

M92: Set axis_steps_per_unit
Xnnn Steps per unit for the X drive
Ynnn Steps per unit for the Y drive
Znnn Steps per unit for the Z drive
Ennn Steps per unit for the extruder drive(s)
Examples
M92 X87. 489 Y87.489 Z87.489
M92 E420:420

Please note that you NEED to have eeprom enabled to save these values! (save sending M500)

M104: Set Extruder Temperature

Example
M104 S190
Snnn = Target temperature

M140: Set Bed Temperature (Fast)
Example
M140 S55
Snnn Target temperature
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. (it will wait until the temperature is 40ºc before it do anything).
NOTE: is better to use M116 commands!

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

M112: Emergency Stop
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.
You just need to send M112!
But be aware!, if you have a hardware problem is better to remove the printer from the power!

 

You can see a lot more G-code commands on the following PDF.

[CMDM-download id=1120]

G-CODE in Russian for 3D printing (Mini-guide)

Often, for high-quality printing, and especially when selecting print parameters, it is necessary to be able to read and edit the G-code during calibration.

A commonplace example: setting your own values ​​for the "Temperature Tower" or creating start and end blocks of codes in slicers for a specific printer.

On some sites (like reprap.org/wiki/G-code) on the Russian-language pages, the commands are only partially described in Russian, and the rest in English. On some domestic sites, the commands are translated into Russian, but some are given with errors - stupidly copy-paste a clumsy translation.

Tired of searching through different sites, trying to find the CORRECT description of a particular command and its parameters.

I made myself such a mini-reference book. I'll be glad if anyone else finds it useful.

I tried to describe the maximum number of commands used, except for very specific ones.

(Yes, special commands for deltas, for example, sorry, I consider them specific and not necessary for me)

However, most commands are supported by all printers and firmware.

Attention! Compliance of commands and parameters is checked only for Marlin firmware.

G-commands

G0(G1) Xnnn Ynnn Znnn Ennn Fnnn – movement.

G0 - fast idle

G1 - linear working travel

Xnnn, Ynnn, Znnn – coordinates.

Еnnn - amount of extruded material in mm (with negative values ​​- retract).

Fnnn – travel speed in mm/min (this speed will be used until the next change).

G0 X12 (will move 12mm in X)

G0 F1500 (Set travel speed to 1500 mm/min. )

G1 X90.6 Y13.8 E22.4 (Move 90.6mm in X and 13.8mm in Y while extruding 22.4mm of material.)

G4 .

Pnnn - Timeout, in milliseconds

Snnn - Timeout in seconds.

"G4 S2" and "G4 P2000" - equivalent to

G10 - Plastic rollback (Retract)

Filament rollback according to M207 settings.

G11 - Plastic feed

Feed / reposition the head according to M208 settings.

G20 - Inch unit setting

G21 - Setting the units in millimeters

From now on, the reading will be in inches/millimeters.

G28 - Move to start ("home") until limit switches actuate

G28 – home on all axes.

G28 X Z - Move home only in X and Z axes

G29 - Create table curvature mesh (MESH_BED_LEVELING)

The command allows you to create a compensation (Z-height) grid and use it later when printing. The grid can be used repeatedly even after the printer is turned off.

After using the G28 command, the mesh created by the G29 command flies off.

It is necessary to save the rhinestone mesh after it has been created! To recall the grid from memory, use the M420 command.

Be sure to use G28 before using G29, otherwise the mesh will be incorrect.

Creating Mesh Bed Leveling manually (via commands):

1. Enter G29 S0 to start meshing.

2. Enter G29 S1 to set the first grid point.

3. Align the nozzle with paper (as usual).

4. Enter G29 S2 to save the value and jump to a new point

5. Repeat steps 3 and 4 until the creation procedure is completed.

6. Enter M500 to write the resulting mesh to EEPROM.

Creating Mesh Bed Leveling using the printer menu (the function must be active in the firmware):

1. Select Prepare followed by Auto home (aka G28 command).

2. Select Prepare and then Level Bed.

3. Wait for on-screen instructions to begin. Press the "twist" on the screen when the inscription "Click to Begin" appears. The head will go to the first grid point.

4. Use the thumbwheel to raise or lower the nozzle to align the nozzle with the paper. Same as when leveling the table. After you have achieved the desired gap between the nozzle and the piece of paper, press the "twist". The head will move to a new grid point.

5. Repeat step 4 until the program has passed all points.

6. When finished, enter the Control menu and select the Store memory item to save the created mesh to EEPROM.

To use the grid stored in EEPROM when printing, use the command

M420 S1 (See M420).

G90 - Setting absolute coordinates

All coordinates are absolute relative to the machine origin.

G91 - Set relative coordinates

All coordinates from now on become relative to the last position. Marlin translates all axes into relative coordinates, including the extruder.

G92 Xnnn Ynnn Znnn Ennn - Set position

This command can be used without any additional parameters.

G92 - reset all axis coordinates to zero.

Xnnn - new X coordinate

Ynnn - new Y coordinate

Znnn - new Z coordinate

Ennn - new extruder position

Example: G92 X10 E90

M-commands

M17 - Enable/Enable all stepper motors

M18 - Remove current from motors

Motors can be turned by hand. Command analog M84

M20 - List of files on SD card

M21 - SD card initialization

If the SD card is loaded when the printer is turned on, this will happen by default. The SD card must be initialized for other SD card functions to work.

M22 - Release SD card

The specified SD card will be released. On future (random) read attempts, a guaranteed error occurs. Useful before removing the SD card.

M23 - Select file on SD card

Example: M23 filename.gco

M24 - Start/continue printing from SD card

The printer will print from the file selected with the M23 command.

M25 - SD card print pause

M28 - Start writing to SD card

Example: M28 filename.gco.

A file is created on the SD card, designated as filename.gco (if the file exists, it is overwritten) and all subsequent commands to the printer are written to this file.

M29 - Stop writing to SD card

Example: M29 filename.gco

The file opened by the M28 command is closed and all subsequent commands are executed by the printer in normal mode.

M30 - Delete file from SD card

Example: M30 filename.gco. filename. gco will be deleted.

M32 - Select file and start printing from SD card

Example: M32 filename.gco.

Used for SD card printing and works the same as M23 and M24

M80 - Enable ATX Power Supply

Puts the ATX power supply into sleep mode. Does not work on electronics without sleep mode.

M81 - Turn off the ATX power supply

M82 - Set the extruder to absolute mode

M83 - Set extruder to relative mode

Allows extruder to be extruder in absolute/relative units

M84 SNNN X, Y, Z, E - transfer motors to the waiting mode of

SNNN - time per seconds.

If a timeout is specified with Snnn, this command simply sets the stepper motor inactivity timeout.

If no motors (X,Y,Z or E) are specified, this command immediately disables all.

If one or more axes are specified, this command disables the specified ones immediately. For example, "M84 S10" will put stepper motors into standby mode after 10 seconds of inactivity.

M92 Xnnn Ynnn Znnn Ennn - Set the number of steps per axis per unit

Ennn - steps per unit for extruder

Examples: M92 X87.489 Y87.489 Z87.489 or M92 E420

Allows you to set the number of steps per unit (usually mm) for motors. These values ​​are replaced with the values ​​from the firmware at power up unless written to the EEPROM see M500.

M104 Snnn - Set extruder temperature and DO NOT wait

Snnn - Set temperature

Example: M104 S190

Sets the temperature of the active extruder 190C and immediately returns control (that is, DOES NOT WAIT for the extruder to reach the set temperature). See also M109

M105 - Get Extruder Temperature

Gets the temperature of the active extruder and hot bed in degrees Celsius. The temperature is transmitted to the connected computer. The response sent to the computer might look like this: ok T:201 B:117

M106 Snnn - Turn on the fan blowing part

SNNN - fan rotation of fan from 0 to 255 (127 - 50% speed)

m107 - turn off the fan

m108 - cancel the heating 9000 9000 temperature set by M109 and M190, continues printing.

M109 Snnn - Set extruder temperature and wait

Sets the temperature in Celsius and waits for it to be reached. See also M104

M110 Nnnn - Set current line number

Nnnn - Line number

Example: M110 N123

In this example, the number of the current line 123 is set. Thus, it is expected that the next line after this command will be 124.

M112 - Emergency Stop

m114 - receipt of current positions 9

M115 - Get a firmware version

m119 - get the status of ends

m140 - set the temperature of the table and DO NOT wait

Example: M140 S65

Sets the table temperature to 65C and immediately returns control (ie DOES NOT WAIT for the table to reach the set temperature). See also M190

M190 - Set table temperature and wait

Sets the temperature in Celsius and WAITS to reach it. see M140

M200 Dnnn Tnnn - Set the REAL diameter of the filament rod.

Dnnn – diameter in mm.

Tnnn – extruder number. (can be omitted for single extruder printers)

Example: M200 D1.65

Used to calculate the actual extruded volume.

See M404 for rating setting.

M201 Xnnn Ynnn Znnn Ennn - Setting of the maximum accelerations (in mm/s in sq.)

for axes.

Ennn - accelerations in mm/s in sq. for the extruder.

Only one/two of the parameters can be used.

Example: M201 X1000 Y1000 Z100 E2000

Use M500 to store parameters in EEPROM

M202 - Setting the maximum acceleration for simple (idle) movement.

!Not used in Marlin! V mm/s in sq. Example: M202 X1000 Y1000

M203 Xnnn Ynnn Znnn Ennn - Setting the maximum speed (in mm/s)

Xnnn, Ynnn, Znnn - max speed for axes

Ennn - max extruder speed.

Only one/two of the parameters can be used.

Example: M203 X6000 Y6000 Z300 E10000

Use M500 to store parameters in EEPROM.

M204 Pnnn Rnnn Tnnn - Acceleration setting (in mm/sec. in sq.)

Pnnn - Printing acceleration

Rnnn – Retract Acceleration

Tnnn - Accelerations during idle movements

Only one/two of the parameters can be used.

Example: M204 P800 T3000 R9000

Use M500 to store parameters in EEPROM.

M205 Xnnn, Znnn, Ennn - Setting the maximum jerk (jerk) (mm / s)

Xnnn - jerk along the X and Y axes. (Jerks are the same along these axes)

Znnn - jerk along the Z axis.

Ennn - extruder jerk.

Only one/two of the parameters can be used.

Example: M205 X30 Z5 - Set jerk X/Y = 30, Z jerk = 5.

Use M500 to store parameters in EEPROM.

М206 Xnnn, Ynnn, Znnn - Set offsets relative to limit switches (zero)

Similar to G92 command, but these offsets can be written to EEPROM see M500.

Example: M206 X10.0 Y10.0 Z-0.4

M207 Snnn Fnnn Znnn - Set retract parameters (bar retraction)

Snnn - positive retract value in mm.

Fnnn – feedrate mm/sec.

Znnn - lift (lift) of the head along the Z axis in mm during retract. (Helps avoid hitting the model)

Example: M207 S4.0 F2400 Z0.075

Used subsequently for G10 and G11 commands.

Use M500 to store parameters in EEPROM.

M208 Snnn Fnnn – Bar feed recovery parameters after retract

Snnn – positive feed value in mm.

Fnnn – feedrate mm/sec.

Use M500 to store parameters in EEPROM.

M209 Snnn – On/off automatic retraction

Snnn – value 1 – on, 0 – off

Used if the slicer does not support the G10 and G11 commands.

Each extrusion command will be classified as a retract, depending on the value (positive or negative).

M218 Tnnn Xnnn Ynnn – head offset setting

Tnnn - head number

Xnnn, Ynnn – X,Y coordinates.

Example: M218 T0 X50 Y10.5

M301 Hnnn Pnnn Innn Dnnn — Write hotend PID parameters(!)

Hnnn – extruder number. h2 - the first exruder (hotend).

Pnnn - Proportional gain (Kp)

Innn - Integral factor (Ki)

Dnnn - Derivative coefficient (Kd)

Example: M301 h2 P1 I2 D3

Use M500 to store parameters in EEPROM.

See M304 for writing table PID.

M302 Snnn - Allow extrusion at Snnn and above.

Snnn - Set temperature

Example: M302 S170 – enable extrusion (turn on the extruder motor) at a nozzle temperature of 170C and above. M302 S0 - extrude at any temperature.

M303 Ennn Snnn Cnnn - Start PID calibration process for table/hotend

Ennn - E0 hotend, E1 table.

Snnn is the calibration temperature.

Cnnn – number of calibration cycles. More cycles - more precise parameters.

Example M303 E1 C8 S110 – table PID calibration at 110C for 8 cycles.

The PID parameters will be displayed as a string on the terminal screen of a program running in connection with the printer, such as Repetier-Host.

M304 Pnnn Innn Dnnn - Write table PID parameters(!)

Pnnn - Coefficient proportional (Kp)

Innn - Integral factor (Ki)

Dnnn - Derivative coefficient (Kd)

Example: M301 h2 P1 I2 D3

M301 - without parameters will display the current parameters.

Use M500 to store parameters in EEPROM.

For writing extruder PID see M301.

М404 Wnnn - Setting the nominal filament thickness 1.75 or 3.

Wnnn - nominal (theoretical) filament thickness in mm.

Example: M404 W1.75

M404 - without parameters, will display the current nominal value as a string.

This value is used to determine the percentage difference in the automatic rate adjustment in response to the measured filament width and must match the value used for the filament width in slicer settings.

Set actual filament thickness, see M200.

М420 Snnn – Enable/disable the use of the table curvature compensation grid (MESH_BED_LEVELING)

Snnn – S1 on, S0 off.

M420 S1 – use the table curvature compensation grid loaded from EEPROM when printing.

See G29 to get the current status and create a table curvature compensation grid.

M500 - Save data to EEPROM

M501 - Reading data from EEPROM

M600 - Command for automatic filament change

3D Printing G-code Basics: List and Guide

3DPrintStory