3
$\begingroup$

From the M502 documentation page can be read that M502:

Reset all configurable settings to their factory defaults.

Please note that this phrasing from the manual has been used in the question title!

To also reset settings in EEPROM, follow with M500.

Note that:

This command can be used even if EEPROM_SETTINGS is disabled.

The question is what is the definition of "all configurable settings"?

Are these the settings that are displayed with M503, or are there hidden settings?

$\endgroup$

2 Answers 2

5
$\begingroup$

What Marlin does when M502 is called is defined in the configuration_store.cpp file.

It resets:

  • Max acceleration
  • Steps per mm
  • Max feedrate / speed
  • Min segment time
  • Acceleration (Normal, Retract, Travel)
  • Min feedrate
  • Min travel feedrate
  • Jerk settings
  • Junction deviation
  • Home and SCARA offsets
  • Hot end offsets
  • Filament runout sensor distance
  • Tool change parameters (Swap length, extra prime, prime speed, retract speed, Park positions, Z raise)
  • Backlash correction distances and smoothing parameters
  • Extensible UI
  • Magnetic parking extruder settings
  • ABL (fade height, stored points, nozzle offset, servo angles
  • Delta calibration data (Height, Endstop offset, radius, rod length, segments per second, calibration radius, trim angle)
  • Dual / triple endstop adjustments
  • Preheat parameters
  • PID parameters
  • self-defined thermistors
  • LCD contrast
  • Power loss recovery
  • Firmware retraction
  • Filament diameter (for volumetric extrusion)
  • Endstops (if disabled)
  • Stepper drivers
  • Linear advance parameters
  • Motor currents (digipot)
  • CNC coordinate system (if selected)
  • Skew correction parameters
  • Advance pause filament change lengths
$\endgroup$
2
  • 1
    $\begingroup$ Any comment on the M503 part of the question? $\endgroup$
    – 0scar
    Commented Nov 27, 2019 at 12:33
  • 2
    $\begingroup$ Note that you can increase what is stored without altering configuracion_store.cpp by just altering the configuration.h and configuration_adv.h $\endgroup$
    – Trish
    Commented Nov 27, 2019 at 13:57
3
$\begingroup$

Technically, the description as "factory settings" is misguiding, as the settings called up are much better described as "firmware defined settings". But since Firmware upgrades usually are rare and far between, these settings can be considered "factory" for the usual user, even as we always urge users to test if their firmware has TRP enabled and upgrade if not so.

Depending on the firmware, this usually means the settings described in this answer, but it could also be more narrow or extend to different and custom settings inside the firmware. Marlin, when it uses EEPROM_SETTINGS, uses Configurations.h and the additional Configurations_adv.h to define what the factory settings are.

For example in this question the firmware defined the additional settings in Configuration_adv.h. Installing firmware does not by itself alter the EEPROM, so these settings needed to be seeded into SRAM via M502 and then saved into EEPROM via M500.

The remaining commands in the M50X series are obviously M501 and M503. M501 overwrites the SRAM settings with those from the EEPROM, useful if you toy with the SRAM settings to troubleshoot or play with offsets in a somewhat safe manner. M503 in turn reports all settings currently in the SRAM, which can be changed during running. Most of these settings can be stored into the EEPROM, if EEPROM_SETTINGS is enabled, but they don't necessarily have to come from the EEPROM at the moment, as they can be altered due to a lot of reasons. Your G-code to print could call for example G20 and M149 K just to mess with you by swapping to Inches and Kelvin, but that would be easily fixable by recalling M501. This following M503 output was given as an example by Sebastian.expert:

G21    ; Units in mm
M149 C ; Units in Celsius
Filament settings: Disabled
M200 D1.75
M200 D0
Steps per unit:
M92 X100.00 Y100.00 Z398.70 E100.00
Maximum feedrates (units/s):
M203 X400.00 Y400.00 Z8.00 E50.00
Maximum Acceleration (units/s2):
M201 X1000 Y1000 Z100 E10000
Acceleration (units/s2): P R T
M204 P400.00 R1000.00 T1000.00
Advanced: S T B X Z E
M205 S0.00 T0.00 B20000 X10.00 Y10.00 Z0.30 E5.00
Home offset:
M206 X0.00 Y0.00 Z0.00
Auto Bed Leveling:
M420 S1 Z0.00
Material heatup parameters:
M145 S0 H195 B55 F0
M145 S1 H205 B60 F0
PID settings:
M301 P52.25 I5.60 D122.00
Z-Probe Offset (mm):
M851 Z-2.41

Note that with a console or terminal, you could sometimes alter EEPROM settings directly via a UI. Among the terminals I know to have this ability is Repetier Host.

$\endgroup$
1
  • $\begingroup$ I totally agree on the "factory" nomenclature! But that is what the documentation states, hence the phrasing in the question! $\endgroup$
    – 0scar
    Commented Nov 27, 2019 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .