What Is the M203 G-Code in Marlin Firmware? (Explained)

There is no denying that modern slicer software and interfaces allow us to perform almost every action without using G-code – and since these interfaces are much more user-friendly, 3D printing enthusiasts often opt to use these graphical interfaces instead of G-code.

On the other hand, G-code is still what makes a 3D printer tick, and having a general understanding of reading and writing G-code will definitely come in handy in the long term for those who use their 3D printers frequently.

Today, our topic is one of the lesser-known but noteworthy G-codes that you can execute in Marlin firmware to configure a vital parameter of your 3D printer, the M203 G-code.

So, what is the M203 G-code in Marlin Firmware?

The M203 (Set Max Feedrate) G-code in Marlin Firmware allows you to configure and view the maximum feed rate values (in millimeters per second, or mm/s for short) for the X; Y, Z, and E (extruder) axes of your 3D printer.

Next up, we will take a deeper look into the functionality of the M203 G-code, find out how to use it, including the process of saving the changes that it brings to the 3D printer permanently, and finally, see if it’s possible the use the M203 G-Code in firmware other than Marlin.

What Is the M203 (Set Max Feedrate) G-Code in Marlin Firmware?

Since the M203 G-code is a configuration command for a parameter that doesn’t require regular tuning, you won’t find yourself frequently using the M203 G-code by any means.

The M203 G-code has two distinct functions relating to the maximum feed rate values of the 3D printer, which are to view and configure the maximum feed rate values for the X, Y, Z, and E axes.

As the syntax of the M203 G-code allows setting distinct speed values for each of these axes, it’s possible to modify the value of each axis separately for the most optimal configuration possible.

The maximum feed rate values essentially act as a limit for the speeds that each of these axes can reach, allowing you to avoid potential issues where the printer may attempt to reach unintended levels of speed that may jeopardize the printing process due to the misconfiguration of other speed-related parameters.

How to Use the M203 G-Code in Marlin Firmware?

Using the M203 G-code in Marlin is not much different than running any other command that modifies the configuration of the 3D printer, especially considering that it doesn’t come with a lot of complex parameters that require optimization.

Using the M203 G-code in Marlin Firmware is a pretty straightforward process, as the syntax of this G-code is uncomplicated, with only four parameters that correspond to each of the printer’s axes and one situational parameter that you will only need if you’re running multiple extruders.

Before we move on to usage, let’s take a quick look at these five parameters:

  • E (mm/s) – Maximum feed rate for the E (extruder) axis
  • T (index) – Index of the target extruder (only needed for multiple extruder setups)
  • X (mm/s) – Maximum feed rate for the X-axis
  • Y (mm/s) –  Maximum feed rate for the Y-axis
  • Z (mm/s) – Maximum feed rate for the Z-axis

With that, let’s take a quick look at an example that displays basic usage:

M203 X150 Y150 Z100 E200

In this example, we have added the X and parameters with the value of 150, the Z parameter with the value of 100, and the E parameter with the value of 200.

As a result of running this G-code, the firmware will set the maximum feed rate values to 150 mm/s for the and axes, 100 mm/s for the Z-axis, and 200 mm/s for the E axis.

Since all the parameters of the M203 G-code are optional, you can use the command to only set one axis if you wish to, or even invoke the G-code without any parameters to display the maximum feed rate values instead of configuring them.

How to Save the Changes of M203 G-Code in Marlin Firmware?

As the changes coming from the M203 G-code will only reside in the volatile memory on the 3D printer, you will need to take an extra step to save these changes into the permanent memory if you would like to keep the settings throughout power cycles.

To save the changes you have performed with the M203 G-code, you will need to invoke the M500 (Save Settings) G-code at any point after you use the M203 G-code and before you turn the printer off, which will store the settings permanently in the EEPROM.

While the printer should run the M501 (Load Settings) G-code whenever you power it on, it’s worth mentioning that you can also load the settings from the EEPROM to the volatile memory manually by using this G-code.

Since any change that you don’t manually save to the EEPROM with the M500 G-code only stays in the volatile memory of the 3D printer that gets reset after each power cycle, it’s vital to complete this step whenever you would like the changes you have made to persist.

Is the M203 G-Code Compatible with Other Firmware?

While the G-code commands for Marlin and other 3D printer firmware, such as RepRapFirmware or Prusa, aren’t identical, there is a sizeable amount of G-codes that serve the same purpose across different firmware.

While the M203 G-code isn’t a part of every single 3D printer firmware, it follows the same syntax and fulfills the same purpose in most widespread 3D printing firmware, such as Prusa, Repetier, RepRapFirmware, Smoothie, and MK4duo.

Even though it’s possible for some firmware to offer additional parameters that extend the functionality of the M203 G-code, the core functionality remains the same throughout the firmware we have mentioned above, meaning that you can use this guide even if you aren’t on Marlin specifically.

Wrapping Up

Even though you won’t find yourself using the M203 G-code regularly as it’s responsible for a parameter that doesn’t require a lot of change between prints, it’s a handy one to keep in the toolbox for the time it may come in useful.

To quickly recap, we can say that the M203 G-code command of Marlin Firmware provides a way to view and configure the maximum feed rate figures separately for the X, Y, Z, and E axes of the 3D printer in a straightforward manner.

As modifying this parameter impacts the speed cap of all the actions the 3D printer performs directly, it’s a parameter that we recommend configuring carefully to avoid potential issues. 

Happy printing!