From aa5a7f5c13bd6d31360c75d1d3ba233d1b33b87b Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Sat, 8 Aug 2020 12:14:26 -0400 Subject: [PATCH] Add SKR12Pro Support --- Marlin/Configuration.h | 132 +++++++++++++++++++++++-------------- Marlin/Configuration_adv.h | 67 ++++++++++++++----- 2 files changed, 130 insertions(+), 69 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 97c4f4de77..17be399234 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -41,6 +41,8 @@ //#define autoCalibrationKit +//#define SKR12Pro + //////////////////////////////////DO not edit below here unless you know what youre doing! ////////////////////////////////// /** @@ -165,14 +167,20 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 0 +#if ENABLED(SKR12Pro) + #define SERIAL_PORT -1 +#else + #define SERIAL_PORT 0 +#endif /** * Select a secondary serial port on the board to use for communication with the host. * Currently Ethernet (-2) is only supported on Teensy 4.1 boards. * :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7] */ -//#define SERIAL_PORT_2 -1 +#if ENABLED(SKR12Pro) + #define SERIAL_PORT_2 1 +#endif /** * This setting determines the communication speed of the printer. @@ -190,11 +198,13 @@ // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD -#if ENABLED(TREX3) - #define MOTHERBOARD BOARD_FORMBOT_TREX3 -#else - #define MOTHERBOARD BOARD_FORMBOT_TREX2PLUS -#endif + #if ENABLED(SKR12Pro) + #define MOTHERBOARD BOARD_BTT_SKR_PRO_V1_2 + #elif ENABLED(TREX3) + #define MOTHERBOARD BOARD_FORMBOT_TREX3 + #else + #define MOTHERBOARD BOARD_FORMBOT_TREX2PLUS + #endif #endif // Optional custom name for your RepStrap or other custom machine @@ -634,7 +644,7 @@ * heater. If your configuration is significantly different than this and you don't understand * the issues involved, don't use bed PID until someone else verifies that your hardware works. */ -//#define PIDTEMPBED +#define PIDTEMPBED //#define BED_LIMIT_SWITCHING @@ -790,38 +800,58 @@ * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -#if ENABLED(X_2208) - #define X_DRIVER_TYPE TMC2208_STANDALONE - #define X2_DRIVER_TYPE TMC2208_STANDALONE + +#if ENABLED(SKR12Pro) + #if ENABLED(TMC2209Upgrade) + #define X_DRIVER_TYPE TMC2209 + #define X2_DRIVER_TYPE TMC2209 + #define Y_DRIVER_TYPE TMC2209 + #define Z_DRIVER_TYPE TMC2209 + #define E0_DRIVER_TYPE TMC2209 + #define E1_DRIVER_TYPE TMC2209 + #else + #define X_DRIVER_TYPE TMC2208 + #define X2_DRIVER_TYPE TMC2208 + #define Y_DRIVER_TYPE TMC2208 + #define Z_DRIVER_TYPE TMC2208 + #define E0_DRIVER_TYPE TMC2208 + #define E1_DRIVER_TYPE TMC2208 + #endif #else - #define X_DRIVER_TYPE A4988 - #define X2_DRIVER_TYPE A4988 -#endif -#if ENABLED(Y_2208) - #define Y_DRIVER_TYPE TMC2208_STANDALONE -#elif ENABLED(Y_4988) - #define Y_DRIVER_TYPE A4988 -#else - #define Y_DRIVER_TYPE DRV8825 -#endif -#if ENABLED(Z_2208) - #define Z_DRIVER_TYPE TMC2208_STANDALONE -#elif ENABLED(Z_4988) - #define Z_DRIVER_TYPE A4988 -#else - #define Z_DRIVER_TYPE DRV8825 -#endif -//#define Y2_DRIVER_TYPE A4988 -//#define Z2_DRIVER_TYPE A4988 -//#define Z3_DRIVER_TYPE A4988 -//#define Z4_DRIVER_TYPE A4988 -#if ENABLED(E_2208) - #define E0_DRIVER_TYPE TMC2208_STANDALONE - #define E1_DRIVER_TYPE TMC2208_STANDALONE -#else - #define E0_DRIVER_TYPE DRV8825 - #define E1_DRIVER_TYPE DRV8825 + #if ENABLED(X_2208) + #define X_DRIVER_TYPE TMC2208_STANDALONE + #define X2_DRIVER_TYPE TMC2208_STANDALONE + #else + #define X_DRIVER_TYPE A4988 + #define X2_DRIVER_TYPE A4988 + #endif + #if ENABLED(Y_2208) + #define Y_DRIVER_TYPE TMC2208_STANDALONE + #elif ENABLED(Y_4988) + #define Y_DRIVER_TYPE A4988 + #else + #define Y_DRIVER_TYPE DRV8825 + #endif + #if ENABLED(Z_2208) + #define Z_DRIVER_TYPE TMC2208_STANDALONE + #elif ENABLED(Z_4988) + #define Z_DRIVER_TYPE A4988 + #else + #define Z_DRIVER_TYPE DRV8825 + #endif + //#define Y2_DRIVER_TYPE A4988 + //#define Z2_DRIVER_TYPE A4988 + //#define Z3_DRIVER_TYPE A4988 + //#define Z4_DRIVER_TYPE A4988 + #if ENABLED(E_2208) + #define E0_DRIVER_TYPE TMC2208_STANDALONE + #define E1_DRIVER_TYPE TMC2208_STANDALONE + #else + #define E0_DRIVER_TYPE DRV8825 + #define E1_DRIVER_TYPE DRV8825 + #endif #endif + //#define E2_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988 //#define E4_DRIVER_TYPE A4988 @@ -868,7 +898,7 @@ * following movement settings. If fewer factors are given than the * total number of extruders, the last value applies to the rest. */ -//#define DISTINCT_E_FACTORS +#define DISTINCT_E_FACTORS /** * Default Axis Steps Per Unit (steps/mm) @@ -889,7 +919,7 @@ #define Z_STEPSMM 1600 #endif -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, Y_STEPSMM, Z_STEPSMM, 93 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, Y_STEPSMM, Z_STEPSMM, 93, 93 } /** * Default Max Feed Rate (mm/s) @@ -901,7 +931,7 @@ #else #define Y_MAXFEED 150 #endif -#define DEFAULT_MAX_FEEDRATE { 200, Y_MAXFEED, 8, 75 } +#define DEFAULT_MAX_FEEDRATE { 200, Y_MAXFEED, 8, 75, 75 } #define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 #if ENABLED(LIMITED_MAX_FR_EDITING) @@ -914,7 +944,7 @@ * Override with M201 * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_ACCELERATION { 750, 500, 400, 3000 } +#define DEFAULT_MAX_ACCELERATION { 750, 500, 400, 3000, 3000 } #define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 #if ENABLED(LIMITED_MAX_ACCEL_EDITING) @@ -951,7 +981,7 @@ //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 #if ENABLED(LIMITED_JERK_EDITING) - #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10, 10 } // ...or, set your own edit limits #endif #endif @@ -1243,17 +1273,17 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#if ENABLED(X_2208) +#if ANY(X_2208, SKR12Pro) #define INVERT_X_DIR true #else #define INVERT_X_DIR false #endif -#if ENABLED(Y_2208) +#if ANY(Y_2208, SKR12Pro) #define INVERT_Y_DIR true #else #define INVERT_Y_DIR false #endif -#if ENABLED(Z_2208) +#if ANY(Z_2208, SKR12Pro) #define INVERT_Z_DIR false #else #define INVERT_Z_DIR true @@ -1261,7 +1291,7 @@ // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. -#if ENABLED(E_2208) && DISABLED(TREX3) +#if ANY(E_2208, SKR12Pro) && DISABLED(TREX3) #define INVERT_E0_DIR true #define INVERT_E1_DIR false #else @@ -1802,11 +1832,11 @@ // Move the nozzle to the initial position after cleaning #define NOZZLE_CLEAN_GOBACK - // For a purge/clean station that's always at the gantry height (thus no Z move) - //#define NOZZLE_CLEAN_NO_Z + // Enable for a purge/clean station that's always at the gantry height (thus no Z move) + #define NOZZLE_CLEAN_NO_Z // For a purge/clean station mounted on the X axis - //#define NOZZLE_CLEAN_NO_Y + #define NOZZLE_CLEAN_NO_Y // Explicit wipe G-code script applies to a G12 with no arguments. //#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0" @@ -2561,7 +2591,7 @@ // 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 // is too low, you should also increment SOFT_PWM_SCALE. -#if ENABLED(TREX3) +#if ENABLED(TREX3) && DISABLED(SKR12Pro) #define FAN_SOFT_PWM #endif // Incrementing this by 1 will double the software PWM frequency, diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index c35d4cc931..eb1e33e1af 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -474,7 +474,10 @@ * 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. */ -#if ENABLED(TREX3) +#if BOTH(SKR12Pro, TREX3) + #define E0_AUTO_FAN_PIN FAN2_PIN + #define E1_AUTO_FAN_PIN FAN2_PIN +#elif ENABLED(TREX3) #define E0_AUTO_FAN_PIN 6 #define E1_AUTO_FAN_PIN 45 #else @@ -511,7 +514,9 @@ */ #define CASE_LIGHT_ENABLE #if ENABLED(CASE_LIGHT_ENABLE) - //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #if ENABLED(SKR12Pro) + #define CASE_LIGHT_PIN HEATER_2_PIN // Override the default pin if needed + #endif #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 255 // Set default power-up brightness (0-255, requires PWM pin) @@ -871,7 +876,11 @@ // Increase the slowdown divisor for larger buffer sizes. #define SLOWDOWN #if ENABLED(SLOWDOWN) - #define SLOWDOWN_DIVISOR 2 + #if ENABLED(SKR12Pro) + #define SLOWDOWN_DIVISOR 6 + #else + #define SLOWDOWN_DIVISOR 2 + #endif #endif /** @@ -955,7 +964,9 @@ #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). - //#define CALIBRATION_REPORTING + #if ENABLED(SKR12Pro) + #define CALIBRATION_REPORTING + #endif // The true location and dimension the cube/bolt/washer on the bed. #define CALIBRATION_OBJECT_CENTER { 264.0, 25.0, 12.5 } // mm @@ -974,7 +985,11 @@ // Define the pin to read during calibration #ifndef CALIBRATION_PIN - #define CALIBRATION_PIN 58 // Override in pins.h or set to -1 to use your Z endstop + #if ENABLED(SKR12Pro) + #define CALIBRATION_PIN Z_MAX + #else + #define CALIBRATION_PIN 58 // Override in pins.h or set to -1 to use your Z endstop + #endif #define CALIBRATION_PIN_INVERTING true // Set to true to invert the pin //#define CALIBRATION_PIN_PULLDOWN #define CALIBRATION_PIN_PULLUP @@ -1351,7 +1366,9 @@ * * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] */ - //#define SDCARD_CONNECTION LCD + #if ENABLED(SKR12Pro) + #define SDCARD_CONNECTION ONBOARD + #endif #endif // SDSUPPORT @@ -1434,8 +1451,11 @@ //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames //#define STATUS_HEAT_PERCENT // Show heating in a progress bar - #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) - //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + #if DISABLED(SKR12Pro) + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash) + #else + #define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~‭3260 (or ~940) bytes of PROGMEM. + #endif // Frivolous Game Options //#define MARLIN_BRICKOUT @@ -1665,7 +1685,7 @@ * See https://marlinfw.org/docs/features/lin_advance.html for full instructions. */ #if DISABLED(E_2208) || ENABLED(E_Spreadcycle) - #define LIN_ADVANCE + //#define LIN_ADVANCE #endif #if ENABLED(LIN_ADVANCE) //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants @@ -1807,7 +1827,7 @@ // // G2/G3 Arc Support // -#if DISABLED(autoCalibrationKit) +#if DISABLED(autoCalibrationKit, SKR12Pro) #define ARC_SUPPORT // Disable this feature to save ~3226 bytes #endif #if ENABLED(ARC_SUPPORT) @@ -1906,7 +1926,9 @@ // The number of linear moves that can be in the planner at once. // The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g. 8, 16, 32) -#if BOTH(SDSUPPORT, DIRECT_STEPPING) +#if ENABLED(SKR12Pro) + #define BLOCK_BUFFER_SIZE 64 +#elif BOTH(SDSUPPORT, DIRECT_STEPPING) #define BLOCK_BUFFER_SIZE 8 #elif ENABLED(SDSUPPORT) #define BLOCK_BUFFER_SIZE 16 @@ -1918,7 +1940,11 @@ // The ASCII buffer for serial input #define MAX_CMD_SIZE 96 -#define BUFSIZE 4 +#if ENABLED(SKR12Pro) + #define BUFSIZE 16 +#else + #define BUFSIZE 4 +#endif // Transmission to Host Buffer Size // To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. @@ -2005,7 +2031,7 @@ * * Note that M207 / M208 / M209 settings are saved to EEPROM. */ -#if ENABLED(ABL_Bilinear) +#if ANY(ABL_Bilinear, SKR12Pro) #define FWRETRACT #endif #if ENABLED(FWRETRACT) @@ -2515,7 +2541,7 @@ * Define your own with: * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V // All axes (override below) + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V // All axes (override below) //#define CHOPPER_TIMING_X CHOPPER_DEFAULT_12V // For X Axes (override below) //#define CHOPPER_TIMING_X2 CHOPPER_DEFAULT_12V //#define CHOPPER_TIMING_Y CHOPPER_DEFAULT_12V // For Y Axes (override below) @@ -2544,7 +2570,7 @@ * M912 - Clear stepper driver overtemperature pre-warn condition flag. * M122 - Report driver parameters (Requires TMC_DEBUG) */ - //#define MONITOR_DRIVER_STATUS + #define MONITOR_DRIVER_STATUS #if ENABLED(MONITOR_DRIVER_STATUS) #define CURRENT_STEP_DOWN 50 // [mA] @@ -2559,7 +2585,7 @@ * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. * M913 X/Y/Z/E to live tune the setting */ - //#define HYBRID_THRESHOLD + #define HYBRID_THRESHOLD #define X_HYBRID_THRESHOLD 100 // [mm/s] #define X2_HYBRID_THRESHOLD 100 @@ -2635,7 +2661,7 @@ * Beta feature! * Create a 50/50 square wave step pulse optimal for stepper drivers. */ - //#define SQUARE_WAVE_STEPPING + #define SQUARE_WAVE_STEPPING /** * Enable M122 debugging command for TMC stepper drivers. @@ -2965,6 +2991,9 @@ //#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC) #endif + #if ENABLED(SKR12Pro) + #define SPINDLE_LASER_ENA_PIN PE4 + #endif /** * Speed / Power can be set ('M3 S') and displayed in terms of: * - PWM255 (S0 - S255) @@ -3344,7 +3373,9 @@ * * Implement M486 to allow Marlin to skip objects */ -//#define CANCEL_OBJECTS +#if ENABLED(SKR12Pro) + #define CANCEL_OBJECTS +#endif /** * I2C position encoders for closed loop control.