diff --git a/firmware/MarlinOnRampsForSnappy.diff b/firmware/MarlinOnRampsForSnappy.diff new file mode 100644 index 0000000..98b759b --- /dev/null +++ b/firmware/MarlinOnRampsForSnappy.diff @@ -0,0 +1,349 @@ +diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h +index 980efc5..4638936 100644 +--- a/Marlin/Configuration.h ++++ b/Marlin/Configuration.h +@@ -25,7 +25,7 @@ + // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this + // build by the user have been successfully uploaded into firmware. + #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time +-#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. ++#define STRING_CONFIG_H_AUTHOR "revarbat@gmail.com" // Who made the changes. + + // SERIAL_PORT selects which serial port should be used for communication with the host. + // This allows the connection of wireless adapters (for instance) to non-default port pins. +@@ -40,16 +40,14 @@ + + // The following define selects which electronics board you have. + // Please choose the name from boards.h that matches your setup +-#ifndef MOTHERBOARD +- #define MOTHERBOARD BOARD_ULTIMAKER +-#endif ++#define MOTHERBOARD BOARD_RAMPS_13_EFF + + // Define this to set a custom name for your generic Mendel, +-// #define CUSTOM_MENDEL_NAME "This Mendel" ++#define CUSTOM_MENDEL_NAME "Snappy" + + // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) + // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) +-// #define MACHINE_UUID "00000000-0000-0000-0000-000000000000" ++//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + + // This defines the number of extruders + #define EXTRUDERS 1 +@@ -101,8 +99,8 @@ + // 147 is Pt100 with 4k7 pullup + // 110 is Pt100 with 1k pullup (non standard) + +-#define TEMP_SENSOR_0 -1 +-#define TEMP_SENSOR_1 -1 ++#define TEMP_SENSOR_0 1 ++#define TEMP_SENSOR_1 0 + #define TEMP_SENSOR_2 0 + #define TEMP_SENSOR_BED 0 + +@@ -156,9 +154,9 @@ + + // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it + // Ultimaker +- #define DEFAULT_Kp 22.2 +- #define DEFAULT_Ki 1.08 +- #define DEFAULT_Kd 114 ++// #define DEFAULT_Kp 22.2 ++// #define DEFAULT_Ki 1.08 ++// #define DEFAULT_Kd 114 + + // MakerGear + // #define DEFAULT_Kp 7.0 +@@ -169,6 +167,11 @@ + // #define DEFAULT_Kp 63.0 + // #define DEFAULT_Ki 2.25 + // #define DEFAULT_Kd 440 ++ ++ #define DEFAULT_Kp 23.02 ++ #define DEFAULT_Ki 1.33 ++ #define DEFAULT_Kd 99.48 ++ + #endif // PIDTEMP + + // Bed Temperature Control +@@ -181,7 +184,7 @@ + // If your configuration is significantly different than this and you don't understand the issues involved, you probably + // shouldn't use bed PID until someone else verifies your hardware works. + // If this is enabled, find your own PID constants below. +-//#define PIDTEMPBED ++#define PIDTEMPBED + // + //#define BED_LIMIT_SWITCHING + +@@ -189,14 +192,14 @@ + // all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis) + // setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did, + // so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED) +-#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current ++#define MAX_BED_POWER 127 // limits duty cycle to bed; 256=full current + + #ifdef PIDTEMPBED + //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) +-//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) +- #define DEFAULT_bedKp 10.00 +- #define DEFAULT_bedKi .023 +- #define DEFAULT_bedKd 305.4 ++//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, argressive factor of .15 (vs .1, 1, 10) ++// #define DEFAULT_bedKp 10.00 ++// #define DEFAULT_bedKi .023 ++// #define DEFAULT_bedKd 305.4 + + //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune +@@ -205,10 +208,14 @@ + // #define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. ++ #define DEFAULT_bedKp 482.42 ++ #define DEFAULT_bedKi 84.61 ++ #define DEFAULT_bedKd 687.63 + #endif // PIDTEMPBED + + + ++ + //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit + //can be software-disabled for whatever purposes by + #define PREVENT_DANGEROUS_EXTRUDE +@@ -313,28 +320,28 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + #define DISABLE_E false // For all extruders + #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled + +-#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true ++#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true + #define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false +-#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true ++#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true + #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false +-#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false ++#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false + #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false + + // ENDSTOP SETTINGS: + // Sets direction of endstops when homing; 1=MAX, -1=MIN + #define X_HOME_DIR -1 + #define Y_HOME_DIR -1 +-#define Z_HOME_DIR -1 ++#define Z_HOME_DIR 1 + + #define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. + #define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. + + // Travel limits after homing +-#define X_MAX_POS 205 ++#define X_MAX_POS 190 + #define X_MIN_POS 0 +-#define Y_MAX_POS 205 ++#define Y_MAX_POS 190 + #define Y_MIN_POS 0 +-#define Z_MAX_POS 200 ++#define Z_MAX_POS 160 + #define Z_MIN_POS 0 + + #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS) +@@ -343,7 +350,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + //============================= Bed Auto Leveling =========================== + + //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) +-#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. ++//#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled. + + #ifdef ENABLE_AUTO_BED_LEVELING + +@@ -359,7 +366,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + // Probe 3 arbitrary points on the bed (that aren't colinear) + // You must specify the X & Y coordinates of all 3 points + +- #define AUTO_BED_LEVELING_GRID ++ //#define AUTO_BED_LEVELING_GRID + // with AUTO_BED_LEVELING_GRID, the bed is sampled in a + // AUTO_BED_LEVELING_GRID_POINTSxAUTO_BED_LEVELING_GRID_POINTS grid + // and least squares solution is calculated +@@ -367,8 +374,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + #ifdef AUTO_BED_LEVELING_GRID + + // set the rectangle in which to probe +- #define LEFT_PROBE_BED_POSITION 15 +- #define RIGHT_PROBE_BED_POSITION 170 ++ #define LEFT_PROBE_BED_POSITION 20 ++ #define RIGHT_PROBE_BED_POSITION 180 + #define BACK_PROBE_BED_POSITION 180 + #define FRONT_PROBE_BED_POSITION 20 + +@@ -392,14 +399,14 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + + + // these are the offsets to the probe relative to the extruder tip (Hotend - Probe) +- #define X_PROBE_OFFSET_FROM_EXTRUDER -25 +- #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 +- #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 ++ #define X_PROBE_OFFSET_FROM_EXTRUDER 0.0 ++ #define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0 ++ #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.1 + + #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. + // Be sure you have this distance over your Z_MAX_POS in case + +- #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min ++ #define XY_TRAVEL_SPEED 6000 // X and Y axis travel speed between probes, in mm/min + + #define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point. + #define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points +@@ -417,7 +424,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, + //it is highly recommended you let this Z_SAFE_HOMING enabled!!! + +- #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area. ++ //#define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area. + // When defined, it will: + // - Allow Z homing only after X and Y homing AND stepper drivers still enabled + // - If stepper drivers timeout, it will need X and Y homing again before Z homing +@@ -465,7 +472,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + // For deltabots this means top and center of the Cartesian print volume. + #define MANUAL_X_HOME_POS 0 + #define MANUAL_Y_HOME_POS 0 +-#define MANUAL_Z_HOME_POS 0 ++#define MANUAL_Z_HOME_POS 160 + //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. + + //// MOVEMENT SETTINGS +@@ -474,11 +481,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + + // default settings + +-#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200.0*8/3,760*1.1} // default steps per unit for Ultimaker +-#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 25} // (mm/sec) +-#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. ++#define DEFAULT_AXIS_STEPS_PER_UNIT {80, 80, 1007.875, 96.0} // default steps per unit for ultimaker ++#define DEFAULT_MAX_FEEDRATE {150, 150, 5, 30} // (mm/sec) ++#define DEFAULT_MAX_ACCELERATION {2000,2000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot. + +-#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves ++#define DEFAULT_ACCELERATION 2000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves + #define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts + + // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +@@ -511,17 +518,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). + // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. + //define this to enable EEPROM support +-//#define EEPROM_SETTINGS ++#define EEPROM_SETTINGS + //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: + // please keep turned on if you can. +-//#define EEPROM_CHITCHAT ++#define EEPROM_CHITCHAT + + // Preheat Constants +-#define PLA_PREHEAT_HOTEND_TEMP 180 ++#define PLA_PREHEAT_HOTEND_TEMP 200 + #define PLA_PREHEAT_HPB_TEMP 70 + #define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 + +-#define ABS_PREHEAT_HOTEND_TEMP 240 ++#define ABS_PREHEAT_HOTEND_TEMP 230 + #define ABS_PREHEAT_HPB_TEMP 100 + #define ABS_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 + +@@ -531,8 +538,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + //#define SDSUPPORT // Enable SD Card Support in Hardware Console + //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error) + //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication +-//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder +-//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking ++//#define ENCODER_PULSES_PER_STEP 4 // Increase if you have a high resolution encoder ++//#define ENCODER_STEPS_PER_MENU_ITEM 1 // Set according to ENCODER_PULSES_PER_STEP or your liking + //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + //#define ULTIPANEL //the UltiPanel as on Thingiverse + //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click +@@ -740,7 +747,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + // leaving it undefined or defining as 0 will disable the servo subsystem + // If unsure, leave commented / disabled + // +-//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command ++#define NUM_SERVOS 4 // Servo index starts with 0 for M280 command + + // Servo Endstops + // +@@ -765,11 +772,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of + //#define FILAMENT_SENSOR + + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 //The number of the extruder that has the filament sensor (0,1,2) +-#define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel ++#define MEASUREMENT_DELAY_CM 14 //measurement delay in cm. This is the distance from filament sensor to middle of barrel + +-#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation +-#define MEASURED_UPPER_LIMIT 3.30 //upper limit factor used for sensor reading validation in mm +-#define MEASURED_LOWER_LIMIT 1.90 //lower limit factor for sensor reading validation in mm ++#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software. Used for sensor reading validation ++#define MEASURED_UPPER_LIMIT 1.85 //upper limit factor used for sensor reading validation in mm ++#define MEASURED_LOWER_LIMIT 1.65 //lower limit factor for sensor reading validation in mm + #define MAX_MEASUREMENT_DELAY 20 //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM and lower number saves RAM) + + //defines used in the code +diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h +index 50c4581..4db5d4f 100644 +--- a/Marlin/Configuration_adv.h ++++ b/Marlin/Configuration_adv.h +@@ -61,8 +61,8 @@ + //This is for controlling a fan to cool down the stepper drivers + //it will turn on when any driver is enabled + //and turn off after the set amount of seconds from last driver being disabled again +-#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable) +-#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run ++#define CONTROLLERFAN_PIN 10 //Pin used for the fan to cool controller (-1 to disable) ++#define CONTROLLERFAN_SECS 300 //How many seconds, after all motors were disabled, the fan should run + #define CONTROLLERFAN_SPEED 255 // == full speed + + // When first starting the main fan, run it at full speed for the +@@ -75,7 +75,7 @@ + // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE. + // Multiple extruders can be assigned to the same pin in which case + // the fan will turn on when any selected extruder is above the threshold. +-#define EXTRUDER_0_AUTO_FAN_PIN -1 ++#define EXTRUDER_0_AUTO_FAN_PIN 10 + #define EXTRUDER_1_AUTO_FAN_PIN -1 + #define EXTRUDER_2_AUTO_FAN_PIN -1 + #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +@@ -273,7 +273,7 @@ + #define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16] + + // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards) +-#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) ++#define DIGIPOT_MOTOR_CURRENT {185,185,185,185,185} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) + + // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro + //#define DIGIPOT_I2C +@@ -327,7 +327,7 @@ + // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process + // it can e.g. be used to change z-positions in the print startup phase in real-time + // does not respect endstops! +-//#define BABYSTEPPING ++#define BABYSTEPPING + #ifdef BABYSTEPPING + #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions + #define BABYSTEP_INVERT_Z false //true for inverse movements in Z +@@ -356,7 +356,7 @@ + #ifdef ADVANCE + #define EXTRUDER_ADVANCE_K .0 + +- #define D_FILAMENT 2.85 ++ #define D_FILAMENT 1.80 + #define STEPS_MM_E 836 + #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159) + #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUSION_AREA) +@@ -373,7 +373,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st + // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT + // in the pins.h file. When using a push button pulling the pin to ground this will need inverted. This setting should + // be commented out otherwise +-#define SDCARDDETECTINVERTED ++//#define SDCARDDETECTINVERTED + + #ifdef ULTIPANEL + #undef SDCARDDETECTINVERTED