Marlin 2.0 firmware for M2 Rev E, latest bugfix

Have questions or comments about Simplify3D, Slic3r, Cura, Reptier, etc? Or wondering about which CAD software to use...discuss it here...
Post Reply
djw
Posts: 2
Joined: Thu Nov 23, 2017 10:19 pm

Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by djw » Sun Apr 04, 2021 1:00 am

I recently upgraded my M2 Firmware to Marlin V2 Bugfix to get my Makergear M2 Rev E up and running 4/3/2021

I have these features enabled :
250,000 Baud serial rate Enabled- ive also had working up to 1 million baud - but I tuned it down until I know more
PID Tuned Hot end, and BED
Linear Advance Enabled
S Curve Enabled
ARC support enabled
Geetech LCD
SD Card
Serial buffer tuned size expanded to 32 commands with smaller command size width of 45 <- seems to work fine with cura and simplify3d
Custom Accelerations that I like - you need to change these
New default feedrates - you need to change these
Custom Steps per MM on several axis based on what Ive seen on my single M2 machine ive tested on.

ketil
Posts: 50
Joined: Wed Apr 09, 2014 9:58 pm

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by ketil » Tue May 11, 2021 12:29 am

I've just worked my way through the details. I've tried to be conservative to avoid too many changes, so I may not have all possible options enabled. Below is the complete diff of what I've ended up with, relative to the 2.0.x branch of stock Marlin. I guess it's possible to experiment more from here. I had to work out some issues with inverted motors, inverted endstops, some weirdness that appeared to force Z homing (or probing, perhaps) before X and Y were homed, amongst other things.

Like you, I've updated the BAUD_RATE to 250000. I've also dropped support for the old custom M108 command to set the system fan speed. If you didn't use it, no worries, but now you have to use something like M42 I1 P6 S155 to adjust system fan speeds, with the S<value> setting the speed from 0 (off) to 255 (max). Fortunately I found the STARTUP_COMMANDS that let me start the sysfans at startup. Would be interested to know if you have a different solution for the system fans.

For reference, I have an M2 from 2012 (19V/12V PSUs), with a RAMBo rev 1.3L. And I don't use the heated bed at all, but the bed temperature reading appears to be correct.

Code: Select all

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 442f502c3e..2e64b544b4 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -127,7 +127,7 @@
 
 // Choose the name from boards.h that matches your setup
 #ifndef MOTHERBOARD
-  #define MOTHERBOARD BOARD_RAMPS_14_EFB
+  #define MOTHERBOARD BOARD_RAMBO
 #endif
 
 // Name displayed in the LCD "Ready" message and Info menu
@@ -417,7 +417,7 @@
 #define TEMP_SENSOR_5 0
 #define TEMP_SENSOR_6 0
 #define TEMP_SENSOR_7 0
-#define TEMP_SENSOR_BED 0
+#define TEMP_SENSOR_BED 1
 #define TEMP_SENSOR_PROBE 0
 #define TEMP_SENSOR_CHAMBER 0
 #define TEMP_SENSOR_COOLER 0
@@ -510,9 +510,9 @@
     #define DEFAULT_Ki_LIST {   1.08,   1.08 }
     #define DEFAULT_Kd_LIST { 114.00, 114.00 }
   #else
-    #define DEFAULT_Kp  22.20
-    #define DEFAULT_Ki   1.08
-    #define DEFAULT_Kd 114.00
+    #define DEFAULT_Kp   7.0
+    #define DEFAULT_Ki   0.1
+    #define DEFAULT_Kd  12.00
   #endif
 #endif // PIDTEMP
 
@@ -710,13 +710,13 @@
 #endif
 
 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-#define X_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
-#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
-#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
 #define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
 #define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
 #define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
-#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.
+#define Z_MIN_PROBE_ENDSTOP_INVERTING true // Set to true to invert the logic of the probe.
 
 /**
  * Stepper Drivers
@@ -799,14 +799,14 @@
  * Override with M92
  *                                      X, Y, Z, E0 [, E1[, E2...]]
  */
-#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 500 }
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 88.88, 88.88, 400, 471.5 } // Defaults for MakerGear M2
 
 /**
  * Default Max Feed Rate (mm/s)
  * Override with M203
  *                                      X, Y, Z, E0 [, E1[, E2...]]
  */
-#define DEFAULT_MAX_FEEDRATE          { 300, 300, 5, 25 }
+#define DEFAULT_MAX_FEEDRATE          { 500, 500, 10, 25 } // was 500, 500, 250, 200000 - but I'd like to be more cautious
 
 //#define LIMITED_MAX_FR_EDITING        // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
 #if ENABLED(LIMITED_MAX_FR_EDITING)
@@ -819,7 +819,7 @@
  * Override with M201
  *                                      X, Y, Z, E0 [, E1[, E2...]]
  */
-#define DEFAULT_MAX_ACCELERATION      { 3000, 3000, 100, 10000 }
+#define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 30, 10000 }
 
 //#define LIMITED_MAX_ACCEL_EDITING     // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
 #if ENABLED(LIMITED_MAX_ACCEL_EDITING)
@@ -1117,7 +1117,7 @@
  *     But: `M851 Z+1` with a CLEARANCE of 2  =>  2mm from bed to nozzle.
  */
 #define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow
-#define Z_CLEARANCE_BETWEEN_PROBES  5 // Z Clearance between probe points
+#define Z_CLEARANCE_BETWEEN_PROBES  0 // Z Clearance between probe points
 #define Z_CLEARANCE_MULTI_PROBE     5 // Z Clearance between multiple probes
 //#define Z_AFTER_PROBING           5 // Z position after probing is done
 
@@ -1183,9 +1183,9 @@
 // @section machine
 
 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
-#define INVERT_X_DIR false
-#define INVERT_Y_DIR true
-#define INVERT_Z_DIR false
+#define INVERT_X_DIR true
+#define INVERT_Y_DIR false
+#define INVERT_Z_DIR true
 
 // @section extruder
 
@@ -1226,15 +1226,15 @@
 
 // The size of the printable area
 #define X_BED_SIZE 200
-#define Y_BED_SIZE 200
+#define Y_BED_SIZE 250
 
 // Travel limits (mm) after homing, corresponding to endstop positions.
 #define X_MIN_POS 0
 #define Y_MIN_POS 0
 #define Z_MIN_POS 0
-#define X_MAX_POS X_BED_SIZE
-#define Y_MAX_POS Y_BED_SIZE
-#define Z_MAX_POS 200
+#define X_MAX_POS (X_BED_SIZE + 5)
+#define Y_MAX_POS (Y_BED_SIZE + 5)
+#define Z_MAX_POS 205
 
 /**
  * Software Endstops
@@ -1663,7 +1663,7 @@
  *   M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes)
  *   M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
  */
-//#define EEPROM_SETTINGS     // Persistent storage with M500 and M501
+#define EEPROM_SETTINGS     // Persistent storage with M500 and M501
 //#define DISABLE_M503        // Saves ~2700 bytes of PROGMEM. Disable for release!
 #define EEPROM_CHITCHAT       // Give feedback on EEPROM commands. Disable to save PROGMEM.
 #define EEPROM_BOOT_SILENT    // Keep M503 quiet and only give errors during first load
@@ -1927,7 +1927,7 @@
  * SD Card support is disabled by default. If your controller has an SD slot,
  * you must uncomment the following option or it won't work.
  */
-//#define SDSUPPORT
+#define SDSUPPORT
 
 /**
  * SD CARD: ENABLE CRC
@@ -2603,7 +2603,7 @@
 //#define NUM_M106_FANS 1
 
 // Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
-//#define FAST_PWM_FAN
+#define FAST_PWM_FAN
 
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
 // which is not as annoying as with the hardware PWM. On the other hand, if this frequency
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 7d89cf5205..698bc72f75 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -736,7 +736,7 @@
 
 //#define SENSORLESS_BACKOFF_MM  { 2, 2 }     // (mm) Backoff from endstops before sensorless homing
 
-#define HOMING_BUMP_MM      { 5, 5, 2 }       // (mm) Backoff from endstops after first bump
+#define HOMING_BUMP_MM      { 5, 5, 1 }       // (mm) Backoff from endstops after first bump
 #define HOMING_BUMP_DIVISOR { 2, 2, 4 }       // Re-Bump Speed Divisor (Divides the Homing Feedrate)
 
 //#define HOMING_BACKOFF_POST_MM { 2, 2, 2 }  // (mm) Backoff from endstops after homing
@@ -1096,7 +1096,7 @@
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
  */
 //#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
-//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
+#define DIGIPOT_MOTOR_CURRENT { 135,135,125,135,125 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
 //#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
 
 /**
@@ -3520,7 +3520,7 @@
  *
  * Execute certain G-code commands immediately after power-on.
  */
-//#define STARTUP_COMMANDS "M17 Z"
+#define STARTUP_COMMANDS "M42 I1 P6 S155"
 
 /**
  * G-code Macros
@@ -3981,7 +3981,7 @@
 //
 // M42 - Set pin states
 //
-//#define DIRECT_PIN_CONTROL
+#define DIRECT_PIN_CONTROL
 
 //
 // M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe

ibash
Posts: 9
Joined: Wed Sep 08, 2021 8:37 am

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by ibash » Mon Sep 13, 2021 7:52 pm

I started working on a port, no timeline yet, but maybe the diff in the first pr could be useful: https://forum.makergear.com/viewtopic.php?f=9&t=10131

Gwhite
Posts: 380
Joined: Tue Jul 11, 2017 3:38 pm

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by Gwhite » Sat Jul 01, 2023 2:46 pm

I realize the forum has gone very quite, but I hope it's because everyone is just chugging along with their printers, and not having any serious issues.

I'm still interested in updating my M2E firmware to support linear advance. I've never been through the firmware update process, and I'm a bit nervous about "bricking" my printer. From previous posts in this thread, there are at least one or two folks out there who have done this successfully.

I've looked over the update procedure, and it looks pretty straightforward IF you have the bundled Makergear Zip file with the firmware and the Arduino IDE. The IDE is easy enough to get (assuming the latest version is backward compatible). I looked in the factory firmware Zip file, and there's a "Scripts" folder, and over 170 other files. There are a bunch of ".h" (header) files ".C" files and ".cpp" (C++) files. I'm still learning what all that means... The instructions imply that the Arduino IDE is included, but I don't see it.

Is there a well tested set of files someone can share?

Also, does anyone know of a good tutorial on the generic Marlin firmware update process? Even if someone can provide me with a canned set of files, I'd like to understand what is going on under the hood a bit more.

Thanks!

ketil
Posts: 50
Joined: Wed Apr 09, 2014 9:58 pm

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by ketil » Sun Feb 16, 2025 1:29 am

I've updated my old 19v M2 with RAMBo rev 1.3 with the latest Marlin firmware, currently v2.1.2.5. It works fine with this config. My focus has been on getting the baseline working as it was with the original firmware, but I've started including some of the new features, though some need to be enabled in gcode. (I've kep LIN_ADVANCE at 0, and I have not done anything with input shaping yet, though perhaps the Y axis is the most plausible candidate.)

Code: Select all

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 0e22a1a0ab..74e6898102 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -61,7 +61,11 @@
 // @section info
 
 // Author info of this build printed to the host during boot and M115
-#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
+#define STRING_CONFIG_H_AUTHOR "(Ketil, Makergear M2 x1619V config)" // Who made the changes.
+// config based on sources such as:
+// https://forum.makergear.com/viewtopic.php?f=9&t=10063#p42448
+// https://reprap.org/wiki/Rambo_v1.3
+// http://makergear.wikidot.com/m2-firmware
 //#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
 
 /**
@@ -88,7 +92,7 @@
 
 // Choose the name from boards.h that matches your setup
 #ifndef MOTHERBOARD
-  #define MOTHERBOARD BOARD_RAMPS_14_EFB
+  #define MOTHERBOARD BOARD_RAMBO
 #endif
 
 // @section serial
@@ -552,7 +556,7 @@
  *   999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below.
  */
 #define TEMP_SENSOR_0 1
-#define TEMP_SENSOR_1 0
+#define TEMP_SENSOR_1 1
 #define TEMP_SENSOR_2 0
 #define TEMP_SENSOR_3 0
 #define TEMP_SENSOR_4 0
@@ -682,13 +686,13 @@
   #if ENABLED(PID_PARAMS_PER_HOTEND)
     // Specify up to one value per hotend here, according to your setup.
     // If there are fewer values, the last one applies to the remaining hotends.
-    #define DEFAULT_Kp_LIST {  22.20,  22.20 }
-    #define DEFAULT_Ki_LIST {   1.08,   1.08 }
-    #define DEFAULT_Kd_LIST { 114.00, 114.00 }
+    #define DEFAULT_Kp_LIST {  23.59 }
+    #define DEFAULT_Ki_LIST {   2.94 }
+    #define DEFAULT_Kd_LIST {  47.34 }
   #else
-    #define DEFAULT_Kp  22.20
-    #define DEFAULT_Ki   1.08
-    #define DEFAULT_Kd 114.00
+    #define DEFAULT_Kp  23.59
+    #define DEFAULT_Ki   2.94
+    #define DEFAULT_Kd  47.34
   #endif
 #else
   #define BANG_MAX 255    // Limit hotend current while in bang-bang mode; 255=full current
@@ -858,7 +862,8 @@
  * Note: For Bowden Extruders make this large enough to allow load/unload.
  */
 #define PREVENT_LENGTHY_EXTRUDE
-#define EXTRUDE_MAXLENGTH 200
+ // The maximum length should be the full diagonal. sqrt(200^2 + 250^2) is approx 320
+#define EXTRUDE_MAXLENGTH 320
 
 //===========================================================================
 //======================== Thermal Runaway Protection =======================
@@ -1130,9 +1135,9 @@
 #endif
 
 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
-#define X_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
-#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
-#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
+#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
+#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
+#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
 #define I_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
 #define J_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
 #define K_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
@@ -1196,14 +1201,14 @@
  * Override with M92
  *                                      X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
  */
-#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 500 }
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 88.88, 88.88, 400.00, 471.50 }
 
 /**
  * Default Max Feed Rate (linear=mm/s, rotational=°/s)
  * Override with M203
  *                                      X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
  */
-#define DEFAULT_MAX_FEEDRATE          { 300, 300, 5, 25 }
+#define DEFAULT_MAX_FEEDRATE          { 500, 500, 10, 25 }
 
 //#define LIMITED_MAX_FR_EDITING        // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
 #if ENABLED(LIMITED_MAX_FR_EDITING)
@@ -1216,7 +1221,7 @@
  * Override with M201
  *                                      X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
  */
-#define DEFAULT_MAX_ACCELERATION      { 3000, 3000, 100, 10000 }
+#define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 30, 10000 }
 
 //#define LIMITED_MAX_ACCEL_EDITING     // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
 #if ENABLED(LIMITED_MAX_ACCEL_EDITING)
@@ -1245,9 +1250,9 @@
  */
 //#define CLASSIC_JERK
 #if ENABLED(CLASSIC_JERK)
-  #define DEFAULT_XJERK 10.0
-  #define DEFAULT_YJERK 10.0
-  #define DEFAULT_ZJERK  0.3
+  #define DEFAULT_XJERK 20.0
+  #define DEFAULT_YJERK 20.0
+  #define DEFAULT_ZJERK  0.4
   //#define DEFAULT_IJERK  0.3
   //#define DEFAULT_JJERK  0.3
   //#define DEFAULT_KJERK  0.3
@@ -1286,7 +1291,7 @@
  *
  * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained
  */
-//#define S_CURVE_ACCELERATION
+#define S_CURVE_ACCELERATION
 
 //===========================================================================
 //============================= Z Probe Options =============================
@@ -1670,9 +1675,9 @@
 // @section motion
 
 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
-#define INVERT_X_DIR false
-#define INVERT_Y_DIR true
-#define INVERT_Z_DIR false
+#define INVERT_X_DIR true
+#define INVERT_Y_DIR false
+#define INVERT_Z_DIR true
 //#define INVERT_I_DIR false
 //#define INVERT_J_DIR false
 //#define INVERT_K_DIR false
@@ -1725,15 +1730,15 @@
 
 // The size of the printable area
 #define X_BED_SIZE 200
-#define Y_BED_SIZE 200
+#define Y_BED_SIZE 250
 
 // Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions.
 #define X_MIN_POS 0
 #define Y_MIN_POS 0
 #define Z_MIN_POS 0
-#define X_MAX_POS X_BED_SIZE
-#define Y_MAX_POS Y_BED_SIZE
-#define Z_MAX_POS 200
+#define X_MAX_POS (X_BED_SIZE + 5)
+#define Y_MAX_POS (Y_BED_SIZE + 5)
+#define Z_MAX_POS 205
 //#define I_MIN_POS 0
 //#define I_MAX_POS 50
 //#define J_MIN_POS 0
@@ -2130,7 +2135,7 @@
 #endif
 
 // Homing speeds (linear=mm/min, rotational=°/min)
-#define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (4*60) }
+#define HOMING_FEEDRATE_MM_M { (60*60), (60*60), (8*60) }
 
 // Validate that endstops are triggered on homing moves
 #define VALIDATE_HOMING_ENDSTOPS
@@ -2208,7 +2213,7 @@
  *   M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes)
  *   M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
  */
-//#define EEPROM_SETTINGS     // Persistent storage with M500 and M501
+#define EEPROM_SETTINGS     // Persistent storage with M500 and M501
 //#define DISABLE_M503        // Saves ~2700 bytes of flash. Disable for release!
 #define EEPROM_CHITCHAT       // Give feedback on EEPROM commands. Disable to save flash.
 #define EEPROM_BOOT_SILENT    // Keep M503 quiet and only give errors during first load
@@ -2494,7 +2499,7 @@
  * SD Card support is disabled by default. If your controller has an SD slot,
  * you must uncomment the following option or it won't work.
  */
-//#define SDSUPPORT
+#define SDSUPPORT
 
 /**
  * SD CARD: ENABLE CRC
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 6557ad8177..a6f331804b 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -605,7 +605,7 @@
  *   PWM on pin OC2A. Only use this option if you don't need PWM on 0C2A. (Check your schematic.)
  *   USE_OCR2A_AS_TOP sacrifices duty cycle control resolution to achieve this broader range of frequencies.
  */
-//#define FAST_PWM_FAN    // Increase the fan PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
+#define FAST_PWM_FAN    // Increase the fan PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
 #if ENABLED(FAST_PWM_FAN)
   //#define FAST_PWM_FAN_FREQUENCY 31400  // Define here to override the defaults below
   //#define USE_OCR2A_AS_TOP
@@ -726,7 +726,7 @@
 
 // If you want endstops to stay on (by default) even when not homing
 // enable this option. Override at any time with M120, M121.
-//#define ENDSTOPS_ALWAYS_ON_DEFAULT
+#define ENDSTOPS_ALWAYS_ON_DEFAULT
 
 // @section extras
 
@@ -879,7 +879,7 @@
 
 //#define SENSORLESS_BACKOFF_MM  { 2, 2, 0 }  // (linear=mm, rotational=°) Backoff from endstops before sensorless homing
 
-#define HOMING_BUMP_MM      { 5, 5, 2 }       // (linear=mm, rotational=°) Backoff from endstops after first bump
+#define HOMING_BUMP_MM      { 5, 5, 1 }       // (linear=mm, rotational=°) Backoff from endstops after first bump
 #define HOMING_BUMP_DIVISOR { 2, 2, 4 }       // Re-Bump Speed Divisor (Divides the Homing Feedrate)
 
 //#define HOMING_BACKOFF_POST_MM { 2, 2, 2 }  // (linear=mm, rotational=°) Backoff from endstops after homing
@@ -1081,6 +1081,7 @@
  *  X<1>         Set the given parameters only for the X axis.
  *  Y<1>         Set the given parameters only for the Y axis.
  */
+// TODO: Experiment with input shaping
 //#define INPUT_SHAPING_X
 //#define INPUT_SHAPING_Y
 #if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
@@ -1121,7 +1122,7 @@
  * Enable DISABLE_IDLE_* to shut down axis steppers after an idle period.
  * The default timeout duration can be overridden with M18 and M84. Set to 0 for No Timeout.
  */
-#define DEFAULT_STEPPER_TIMEOUT_SEC 120
+#define DEFAULT_STEPPER_TIMEOUT_SEC 180
 #define DISABLE_IDLE_X
 #define DISABLE_IDLE_Y
 #define DISABLE_IDLE_Z    // Disable if the nozzle could fall onto your printed part!
@@ -1311,7 +1312,7 @@
  *    M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
  */
 //#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 }          // Values in milliamps
-//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
+#define DIGIPOT_MOTOR_CURRENT { 135,135,135,165,135 }   // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
 //#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 }    // Default drive percent - X, Y, Z, E axis
 
 /**
@@ -2111,12 +2112,12 @@
  *
  * See https://marlinfw.org/docs/features/lin_advance.html for full instructions.
  */
-//#define LIN_ADVANCE
+#define LIN_ADVANCE
 #if ENABLED(LIN_ADVANCE)
   #if ENABLED(DISTINCT_E_FACTORS)
-    #define ADVANCE_K { 0.22 }    // (mm) Compression length per 1mm/s extruder speed, per extruder
+    #define ADVANCE_K { 0 }    // (mm) Compression length per 1mm/s extruder speed, per extruder
   #else
-    #define ADVANCE_K 0.22        // (mm) Compression length applying to all extruders
+    #define ADVANCE_K 0        // (mm) Compression length applying to all extruders
   #endif
   //#define ADVANCE_K_EXTRA       // Add a second linear advance constant, configurable with M900 L.
   //#define LA_DEBUG              // Print debug information to serial during operation. Disable for production use.
@@ -3728,7 +3729,7 @@
  *
  * Execute certain G-code commands immediately after power-on.
  */
-//#define STARTUP_COMMANDS "M17 Z"
+#define STARTUP_COMMANDS "M42 I1 P6 S100"
 
 /**
  * G-code Macros
@@ -4232,7 +4233,7 @@
 //
 // M42 - Set pin states
 //
-//#define DIRECT_PIN_CONTROL
+#define DIRECT_PIN_CONTROL
 
 //
 // M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe
 
Edit 2025-02-18: I've updated the config, which I have now built with arduino, uploaded to my printer, and I've been testing a bit. This configuration has taken inspiration from Makergear's published configs, djw's description, and new possibilities. The current config features:
  • Updated PID values based on my run of PID autotune. If you don't have the same very old 12v hotend, run autotune yourself and store the values in EEPROM, and/or set the correct PID values in your start.gcode.
  • Changed Makergear's old custom system fan speed M108 S150 (which now conflicts with other uses of M108) to the more generic M42 I1 P6 S150. For example, to stop the sysfan, send M42 I1 P6 S0.
  • 250.000 baud rate
  • SD card support
  • Updated feedrates, not the slow default ones
  • S Curve enabled
  • ARC enabled
  • Linear Advance enabled, but defaults to the K-factor of 0. Calibrate and enable in your gcode with M900 K<your setting> according to https://marlinfw.org/docs/features/lin_advance.html, but I found that a K-factor of 0 was the most accurate for my old hotend.
When I tried going with the original PID values, the printer kept giving THERMAL_RUNAWAY errors, even though there was no thermal runaway. Apparently the PID values don't carry the same meaning across major releases of Marlin, so PID values need to be updated when doing major upgrades.

To run PID autotune, I executed these commands:

Code: Select all

M303 E0 S190 C8
M301 P<Kp> I<Ki> D<Kd>
M500  ; Save to EEPROM
Last edited by ketil on Tue Feb 25, 2025 10:31 pm, edited 8 times in total.

Gwhite
Posts: 380
Joined: Tue Jul 11, 2017 3:38 pm

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by Gwhite » Sun Feb 16, 2025 3:36 pm

MakerGear does have a beta version of Marlin 2.1. I downloaded it about a year ago, but I had a few issues I wanted to fix/investigate, but got tied up with other stuff. They may have a newer version by now.

The things I ran into were:

1) All my motors run backwards. Their recommendation was to open up my electronics box and flip all the wires. My printer is in an enclosure, and that is not a trivial exercise. There is a set of commands for motor direction in the source code, so that should be a simple fix. I wanted to go over the code carefully to make sure I understood what/where the changes were, and that's where I bogged down. I have NO idea why they produced a version with the motors reversed. The 2017 production code and my machine all work fine.

2) I have the Geeetech SD card reader, so I need the support for that. The thing I noticed about the beta version was that it doesn't have the opening MakerGear logo/screen. I figured it should be pretty simple to find the files where that is located in the old code and copy it over.

I would contact Tech Support and get the latest version before you spend a lot of time re-inventing stuff. Please keep us posted on how it works out for you.

ketil
Posts: 50
Joined: Wed Apr 09, 2014 9:58 pm

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by ketil » Sun Feb 16, 2025 8:49 pm

I'm pretty relaxed on updating this myself, as you can see from the thread above I've shared my Marlin config before, and I've already been running my own updated Marlin for several years. My M2 from 2012 is way out of support. I don't expect anyone at Makergear will be testing new firmwares on this dinosaur, if they even remember the details themselves. :lol: Fortunately they shared their config way back when, and it's still available at http://makergear.wikidot.com/m2-firmware under the 12v/19v tab, so I'm adapting from there. I don't expect any further Marlin updates from them on my printer, but perhaps you will get updates for your version. If not, the info on that page might help you out as well.

Regarding your motors running backwards, that's exactly what the following change is for, as you've pointed out. I'm surprised anyone would suggest rewiring instead of just modifying these in the standard config.

Code: Select all

 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
-#define INVERT_X_DIR false
-#define INVERT_Y_DIR true
-#define INVERT_Z_DIR false
+#define INVERT_X_DIR true
+#define INVERT_Y_DIR false
+#define INVERT_Z_DIR true
Not sure on the SD card reader, I'm simply using the one bundled with my original M2. I would expect SD card readers to act the same, so simply enabling SD card reader should do the trick, I think...?

airscapes
Posts: 599
Joined: Wed Jan 31, 2018 11:36 pm

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by airscapes » Sun Feb 16, 2025 10:09 pm

@Gwhite, if you want a stock card reader I think I have one if you want it. Both my boards are now Duet so no use for the card readers. I think you may have my email, but if not ping on here via PM

airscapes
Posts: 599
Joined: Wed Jan 31, 2018 11:36 pm

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by airscapes » Sun Feb 16, 2025 10:10 pm

@Gwhite, if you want a stock card reader I think I have one if you want it. Both my boards are now Duet so no use for the card readers. I think you may have my email, but if not ping on here via PM

ketil
Posts: 50
Joined: Wed Apr 09, 2014 9:58 pm

Re: Marlin 2.0 firmware for M2 Rev E, latest bugfix

Post by ketil » Tue Feb 25, 2025 10:35 pm

Just wanted to bump this thread to make it clear that I've been updating my comment from Feb 16, above. I updated it several times, and the post now contains the config I'm successfully running on my old RAMBo. :)

Post Reply