MPCNC

From docs
Jump to navigation Jump to search

This is a very popular CNC that you can mostly print yourself. The documentation on this page shows you how to setup the firmware on the RAMPs board.

MPCNC Firmware

The firmware available here is built using the Marlin 2.0.5 source. Its designed for the Arduino Mega 2560, Ramps 1.4 board with A4988 steppers with a RepRapDiscount Full Graphics Smart Controller. The settings used to build this can be seen in the (DIY) section. Also the steps/mm doesn't really matter as these are read from EEPROM when device is started. You can change the steps/mm and save them by selecting Configuration -> Store Settings.

Please note that if you ware going to use the firmware take precautions to ensure you don't damage your machine. As the stepper directions can be different based on the way they were plugged in. Keep your finger on the HALT/Reset button in case of issues.

No end-stop support. After using the machine for a little while I found that the endstops are pretty useless. I would recommend not using them. You end up homing the machine by hand anyway since the work piece is not always at [0,0] so the end-stops are pretty much useless.

File:Firmware.hex:Marlin 2.0.5.3 Firmware for the Arduino Mega (mega2560)

Firmware (DIY)

If you want to configure your own firmware then use the following to patch the stock Marlin 2.0.5 firmware source.

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index f02e69ee5a..8079dbd335 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -128,11 +128,11 @@
    
    // Choose the name from boards.h that matches your setup
    #ifndef MOTHERBOARD
-  #define MOTHERBOARD BOARD_RAMPS_14_EFB
+  #define MOTHERBOARD BOARD_RAMPS_14_SF
    #endif
    
    // Name displayed in the LCD "Ready" message and Info menu
-//#define CUSTOM_MACHINE_NAME "3D Printer"
+#define CUSTOM_MACHINE_NAME "CNC"
    
    // Printer's unique ID, used by some programs to differentiate between machines.
    // Choose your own or use a service like http://www.uuidgenerator.net/version4
@@ -142,7 +142,7 @@
    
    // This defines the number of extruders
    // :[1, 2, 3, 4, 5, 6, 7, 8]
-#define EXTRUDERS 1
+#define EXTRUDERS 0
    
    // Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc.
    #define DEFAULT_NOMINAL_FILAMENT_DIA 3.0
@@ -730,14 +730,14 @@
    * Override with M92
    *                                      X, Y, Z, E0 [, E1[, E2...]]
    */
-#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 4000, 500 }
+#define DEFAULT_AXIS_STEPS_PER_UNIT   { 100, 100, 403, 500 }
    
    /**
    * 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          { 1000, 100, 5, 25 }
    
    //#define LIMITED_MAX_FR_EDITING        // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
    #if ENABLED(LIMITED_MAX_FR_EDITING)
@@ -750,7 +750,7 @@
    * Override with M201
    *                                      X, Y, Z, E0 [, E1[, E2...]]
    */
-#define DEFAULT_MAX_ACCELERATION      { 3000, 3000, 100, 10000 }
+#define DEFAULT_MAX_ACCELERATION      { 200, 200, 100, 10000 }
    
    //#define LIMITED_MAX_ACCEL_EDITING     // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
    #if ENABLED(LIMITED_MAX_ACCEL_EDITING)
@@ -765,7 +765,7 @@
    *   M204 R    Retract Acceleration
    *   M204 T    Travel Acceleration
    */
-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration for printing moves
+#define DEFAULT_ACCELERATION          200    // X, Y, Z and E acceleration for printing moves
    #define DEFAULT_RETRACT_ACCELERATION  3000    // E acceleration for retracts
    #define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration for travel (non printing) moves
    
@@ -1058,7 +1058,7 @@
    // 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_Z_DIR true
    
    // @section extruder
    
@@ -1092,8 +1092,8 @@
    // @section machine
    
    // The size of the print bed
-#define X_BED_SIZE 200
-#define Y_BED_SIZE 200
+#define X_BED_SIZE 500
+#define Y_BED_SIZE 500
    
    // Travel limits (mm) after homing, corresponding to endstop positions.
    #define X_MIN_POS 0
@@ -1101,7 +1101,7 @@
    #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 Z_MAX_POS 76
    
    /**
    * Software Endstops
@@ -1442,7 +1442,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
@@ -1656,7 +1656,7 @@
    * you must uncomment the following option or it won't work.
    *
    */
-//#define SDSUPPORT
+#define SDSUPPORT
    
    /**
    * SD CARD: SPI SPEED
@@ -1907,7 +1907,7 @@
    // RepRapDiscount FULL GRAPHIC Smart Controller
    // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
    //
-//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
    
    //
    // ReprapWorld Graphical LCD
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 00f89662c7..a2d3d995ac 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -494,7 +494,7 @@
    * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'.
    */
    
-//#define X_DUAL_STEPPER_DRIVERS
+#define X_DUAL_STEPPER_DRIVERS
    #if ENABLED(X_DUAL_STEPPER_DRIVERS)
    #define INVERT_X2_VS_X_DIR true   // Set 'true' if X motors should rotate in opposite directions
    //#define X_DUAL_ENDSTOPS
@@ -504,7 +504,7 @@
    #endif
    #endif
    
-//#define Y_DUAL_STEPPER_DRIVERS
+#define Y_DUAL_STEPPER_DRIVERS
    #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
    #define INVERT_Y2_VS_Y_DIR true   // Set 'true' if Y motors should rotate in opposite directions
    //#define Y_DUAL_ENDSTOPS
@@ -2806,7 +2806,7 @@
    //#define GCODE_QUOTED_STRINGS  // Support for quoted string parameters
    #endif
    
-//#define GCODE_CASE_INSENSITIVE  // Accept G-code sent to the firmware in lowercase
+#define GCODE_CASE_INSENSITIVE  // Accept G-code sent to the firmware in lowercase
    
    /**
    * CNC G-code options